3

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?

asked Dec 23, 2013 at 13:30
1

3 Answers 3

6

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.

answered Jan 18, 2014 at 4:29
Sign up to request clarification or add additional context in comments.

Comments

0

****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

answered Jun 2, 2017 at 6:32

Comments

0

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

answered Apr 28, 2022 at 12:32

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.