3

If you alreadt have a 32-bit JDK installed, define a JAVA_HOME variable in

Computer>System Properties>System Setting>Enviorment VAriables.

I have allready set the JAVA_HOME path in Enviorment setting.

Whenever, I want to open android studio, this problem will be occure.

I am using 32 bit windows 7 machine and 32 bit 1.8 java version in his machine.

Kamil Budziewski
  • 22,699
  • 14
  • 85
  • 105
  • go to home of android studio folder>> there you can see two android studio.exe setup files..>> click on another one of 32 bit .exe file. – SRB Bans Sep 17 '15 at 07:24
  • have a look at here http://stackoverflow.com/questions/39616303/failed-to-create-jvmerror-code-6-android-studio/41678833#41678833 – Samir Jan 16 '17 at 14:42
  • 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

6

If you overide studio64.exe vm options delete that from .AndroidStudiox.x folder and start androidstudio , it will work

Sankari
  • 53
  • 1
  • 7
4
  1. Go to Android Studio installed location in my case: C:\Program Files\Android\Android Studio\bin.

  2. Edit the studio.exe.vmoptions in administrator mode.

  3. Change the following lines as below: -Xms256m -Xmx512m

  4. You are done.

Hope it helps you.

V-rund Puro-hit
  • 5,518
  • 9
  • 31
  • 50
Krrish
  • 271
  • 3
  • 17
0

I had the same problem after changing the value of Xmx within studio64.exe.vmoptions (inside the directory:.AndroidStudioX.X in the user home directory). I did that after reading the official Google docs how to change the heap size of Android Studio to make it run faster: https://developer.android.com/studio/intro/studio-config.html#adjusting_heap_size

Immediately after this change Android Studio could no longer start and displayed the same error as you posted. Well, soon I found lots of advices here on stackoverflow to delete the studio64.exe.vmoptions file, which worked, but it also changed back the Xmx value to default 1280MB. But I wanted to keep a larger value of the maximum heap size and after lots of searching and trying I finally found the solution. Originally I just uncommented the line starting with Xmx inside studio64.exe.vmoptions and changed the value to 3g. But I didn't delete the rest of that line, so it looked like this:

-Xmx3g #<------ increase this to most of your RAM

But this doesn't work, I had to move the rest of that line to a separate line like this:

# custom Android Studio VM options, see http://tools.android.com/tech-docs/configuration
-Xms512m
#<------ increase this to most of your RAM
-Xmx3g

And this finally worked. I also checked that the Xmx parameter is actually applied by running the jps -lvm command (as described at the Google docs link above).

I think, that the root of this problem was, that the original line (as created by Android Studio itself) was commented out as a whole, and it also contained that comment "#<------ increase this to most of your RAM" which also had another # characted to left of it. So I thought it can stay there, but it just can't, it must be on a separate line, if you uncomment and edit the Xmx parameter.

chose007
  • 3,541
  • 1
  • 13
  • 6
0

I compared studio.exe.vmoptions file with my previous version Android Studio installation. (C:\Users\xxxx\.AndroidStudio3.0\studio.exe.vmoptions)

I changed -Xmx4096m to -Xmx750m as was in previous version and this "error code -6" problem disappeared.

Blue
  • 1
  • 1