Earlier I had jdk 7.
Everything was working well with that. I was able to open Android Studio
as it was well configured with jdk 7
. I was able to create android
project and gradle
successfully.
But while I clicked the run button to run the app in the AVD
, it showed me the error that it was unable to compile the program (the program was a simple Hello World display). It said that it required jdk 8
to compile the program.
So, I installed jdk 8
and the corresponding runtime and created the environment for the both successfully just like I had done for jdk 7
. Now the Android Studio is not ready to start.
It shows the error that
jdk 8 is not a valid JVM.
I have also attached the screenshot of the error, the java
environment variable on my machine and Java
control panel showing the installed Java
Version and runtime version. With jdk 7
, I was able to compile and run simple java
program of hello world on command prompt.
Now, using jdk 8
, the program is getting compiled successfully creating an object file but it is not able to run the program. Even in Control Panel, on opening 'Java', it shows that Java 8
has been successfully installed, configured and enabled on the system.
I am not able to get the problem. The same problem was being faced with 8u91
. So, I also installed 8u92
. Here are the screenshots I uploaded...
Just specify till the jdk version
Dont include the bin folder
Edit your JAVA_HOME variable like this
C:\Program Files\Java\jdk1.8.0_45\
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.