Android Studio JDK location changes back to 1.7 every time it is updated to 1.8 path
Figured it out after looking at a few files inside the Android studio settings directory.
If you've been upgrading your Android Studio and importing settings from previous installations, this might happen (it might also happen with a fresh installation).
Solution:
- Go to wherever your Android Studio config folder is located (usually at $HOME/.AndroidStudio2.1/confg).
- Open the Options folder and delete the file jdk.table.xml (keep a backup just in case)
- Restart Android Studio
This fixed the issue for me. The newly created jdk.table.xml will have updated java8 values (which it most probably fetches from the JDK_HOME environment variable).
close android studio
go to :
C:\Users\WINDOW_USER_NAME\AndroidStudio2.1\config\options
open jdk.table.xml
replace all with your JDK version , in my case replaced all with :
C:/Program Files/Java/jdk1.8.0_101
re-open android-studio
Sync