Reputation: 477
I was just updated my last Android Studio and got this error:
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 Which is not solved.
Upvotes: 23
Views: 29621
Reputation: 404
For Android Studio 4+ You need to remove «\studio.exe.vmoptions» or «studio64.exe.vmoptions» Here is the path
C:\Users\%USERNAME%\AppData\Roaming\Google\{studio version}
Upvotes: 10
Reputation: 55
Go to
C:\Program Files\Android\Android Studio\bin\studio64.exe.vmoptions
Delete studio64.exe.vmoptions file
That's what worked for me
Upvotes: 0
Reputation: 11124
I have rechecked the java path but its not working in my case. So I deleted the Android Studio settings folder in my user folder.
C:\Users\my_username.AndroidStudio
Then re-open Android Studio then everything work fine for me.
In some case is in C:/Users/my_username/.AndroidStudio3.0/studio64.vmoptions.
Upvotes: 23
Reputation: 14253
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
Upvotes: 7
Reputation: 125
All I had to do was run android studio as an administrator. Just right click on the icon on your desktop (do not try to do it with a shortcut pinned to your taskbar) and click run as administrator.
Upvotes: 1
Reputation: 477
finally I got answer here. You need to change vmoptions file from android studio.
Go to Program files > Android > Android Studio > Bin > android studio.exe vmoptions file.
Open it with notepad and change the following attributes :
Change -Xmx512m to -Xmx256m
and -XX:MaxPermSize=250m
to -XX:MaxPermSize=128m
or
Change -Xmx750m to -Xmx512m
and -XX:MaxPermSize=350m
to -XX:MaxPermSize=250m
Upvotes: 8
Reputation: 29
just updating my JDK worked for me! :D If it still doesn't work, try updating Android Studio.
Upvotes: 2
Reputation: 1755
Go to C:\Program Files\Android\Android Studio\bin\studio.exe.vmoptions
Open it with notepad. some times it will not be editable so give administrative permission 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: 55