Reputation: 33
I downloaded the latest version of Android Studio, but I can not use it. The following message appears:
Failed to create JVM: error code -4
JVM Path: C:\Program Files\Java\jdk1.7.0_45\jre
If you already have a 32-bit JDK installed, define a JAVA_HOME variable in Computer > System Properties > System Settings > Environment Variables.
But I've set the JAVA_HOME to
C:\Program Files\Java\jdk1.7.0_45
Added to the end of the Path:
;C:\Program Files\Java\jdk1.7.0_45\bin
javaDebug
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) Client VM (build 24.45-b08, mixed mode, sharing)
What is wrong?
Upvotes: 3
Views: 9016
Reputation: 477
Please follow below steps to resolve this issue. Go to C:\Program Files\Android\Android Studio\bin\studio.exe.vmoptions
Open it in notepad and change the following attributes:.
-Xmx512m to -Xmx256m -XX:MaxPermSize=250m to -XX:MaxPermSize=128m
Or change:
-Xmx750m to -Xmx512m -XX:MaxPermSize=350m to -XX:MaxPermSize=250m
Upvotes: 0
Reputation: 617
****Worked solution for me*****
If you have recently modified Custom VM Options using Help menu, then you should undo your changes or if you have created a new VM options file, remove it. The file can be found on this path:
C:\Users.AndroidStudio2.1 https://stackoverflow.com/a/42858136/4111151
Upvotes: 0
Reputation: 415
You need to edit your vmoptions file (in my case it was in C:\Program Files\Android\android-studio\bin\studio.exe.vmoptions), open it with a text editor and reduce the values of -Xmx and -XX:PermSize (change -Xmx512m to -Xmx256m and -XX:MaxPermSize=250m to -XX:MaxPermSize=128m). Save it and restart the IDE.
Upvotes: 6