2

I set the JAVA_HOME and PATH in environment variables but now android studio is giving to me a new error. here is error:

Failed to create JVM:error code -6.
JVM path:C:\Program Files\java\jdk1.9.0
if you already have a 64-bit JDKinstalled, define a JAVA_HOME variable in

enter image description here

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97
mama23n
  • 135
  • 2
  • 3
  • 10
  • 1
    You need an installation of JDK v1.7. See my answer below. –  Jun 20 '15 at 14:03
  • Possible duplicate of [failed to create jvm error code 4 android studio](http://stackoverflow.com/questions/33094132/failed-to-create-jvm-error-code-4-android-studio) – Rabbit Guy Apr 12 '16 at 12:58
  • I have also [answered on another thread](https://stackoverflow.com/a/66532284/5376073) what was working for me. – Tomislav Brabec Mar 08 '21 at 15:20

4 Answers4

4

At this point in time, Android supports up to JDK v1.7. See here for more technical info.

You can get the latest JDK v1.7 release 79 here.

Note: You can have multiple JDK versions installed on your computer, but you need your JAVA_HOME variable to point to the installation of JDK v1.7 for Android Studio to work:

JAVA_HOME=C:\Program Files\Java\jdk1.7.0_79

Also, remember to download the correct 32-bit or 64-bit version of JDK v1.7 for your current operating system.

1

I hit this problem on my Windows 10 computer after updating my vm settings. The only way I managed to solve this was to remove my Android Studio config data:-

C:\Users\myuseraccount\.AndroidStudio2.2

I literally removed this entire folder and everything worked well again.

Phill Wiggins
  • 2,577
  • 4
  • 28
  • 33
0

Uninstall and reinstall again, then set the JAVA_HOME variable again.

Reference: https://youtu.be/ccWyL0QPLUc

double-beep
  • 5,031
  • 17
  • 33
  • 41
-2

do you have jdk 32-bit and 64-bit installed on your computer , if so try to install one of them and only one

Lama Sonmez
  • 93
  • 1
  • 16