Friday, September 30, 2016

You are an enthusiastic Java programmer who just learned about developing Android apps in Java. To start with you have installed Android Studio, which is the official Integrated Development Environment (IDE) for Android app development, based on IntelliJ IDEA, but as soon as you click on the Android Studio Desktop Icon to start Android Studio you are getting "No JVM installation found. Please install a 64-bit JDK" error? How do you solve this problem? Well, even though the error message is same, every problem is different depending upon your machine, the Java version, whether your desktop or laptop has 32-bit or 64-bit OS e.g. Windows 8.1 or Windows 10. Whether you have installed 32-bit Java or 64-bit JDK e.g. JDK 1.8.0 and what is the value of JAVA_HOME environment variable or whether you have defined it or not.

I'll go through a couple of examples to solve "No JVM installation found. Please install a 64-bit JDK" error based upon some common scenarios. Most likely you would be able to solve your problem by following these steps, but if you are not then just paste following details and we should be able to help you out

Solution 1 - You are running Android Studio on 32-bit Machine

If you are running Android Studio on 32-bit machine e.g. Windows 7 then you need to make sure that Android Studio is also instructed to use that. You can do so by setting your JAVA_HOME to point to your 32-bit JDK and then changing the target exe file of Android Studio desktop shortcut. By default start icon of Android Studio refers to studio64.exe file, which requires 64-bit Java installation. Just change it to refer studio.exe, which can run on 32-bit JVM.

In short,
- Make sure JAVA_HOME points to 32-bit Java, if you don't know how to set JAVA_HOME, see here
- Make sure Android desktop icon point to studio.exe instead of the studio64.exe file.

Solution 2 - No JAVA_HOME variable

The Android Studio make use of JAVA_HOME environment variable to find the JVM installation. If you have not set the JAVA_HOME then you must do so by going into My Computer -> System Properties -> System Settings ->Environment Variables. Make sure your JAVA_HOME points to 64-bit JDK installation e.g. JDK 1.8.0. You can download 64-bit Java from Oracle's download website.

Remember, you can install both 32-bit and 64-bit JVM on a 64-bit operating system like Windows 10. So, please ensure you download the correct Java installer i.e. the 64-bit JDK installer. If you are also first time starting development with Android, I suggest you reading Head First Android Development, the best book to start with Android.

Solution 3 - Android Studio icon pointing to studio.bat file

If you have installed an Android Studio where Android studio icon is pointing to a studio.bat file instead of studio64.exe then you follow these steps to solve "No JVM installation found. Please install a 64-bit JDK" error

goto the AndroidStudio installation folder.
goto bin folder and open studio.bat in text editor
add set JAVA_HOME=C:\Program Files\Java2\jdk1.8.0//your java path after the ECHO line.
goto Start -> All Programmes -> Android Studio ->
right click on Android Studio and click on properties.
You will see the Target something like android-studio\bin\studio64.exe
change it to android-studio\bin\studio.bat

That's all about how to solve "No JVM installation found. Please install a 64-bit JDK" error while starting Android Studio in Windows 10. As I said, your setup might be a little bit different, so if these solutions doesn't solve your problem and you are still getting "No JVM installation found. Please install a 64-bit JDK" error then please share the necessary details as requested in the first paragraph and I'll help you to troubleshoot and solve this problem. If you want to learn more about Android tools and developments, I suggest you read Android in Action 3rd edition. One of the better Android books for Java developers.