intellij idea failed to create JVM error code -1
Asked Answered
L

16

10

I have intellij-idea installed. Although I have set JAVA_HOME environment variable referring to "C:\Program Files\Java\jdk1.8.0_45" but when I try to run it, I end up with the following error:

failed to create JVM: error code -1. JVM path: "C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.2\jre64\" if you have a 64-bit jdk installed, define a JAVA_HOME variable in Computer> system variables> system settings> environment variables.

Windows 7_ 64-bit

Leroy answered 23/8, 2017 at 18:5 Comment(7)
Are you on a 32bit OS ?Dabster
Please specify your windows versionDreda
See intellij-support.jetbrains.com/hc/articles/206544879 and https://mcmap.net/q/1160540/-intellij-idea-failed-to-run.Monolithic
Windows 7 ultimate service pack1 _ 64-bit operating systemLeroy
You can manually edit the idea.exe.vmoptions property file to specify the exact java path and try again.Caritacaritas
simply try java -version on command prompt, if it is not detected, then set the java path and make sure it works fine in command prompt, then try with ide.Caritacaritas
I removed -Xmx1024m from ea -Xmx1024m from idea64.exe.vmoptions file. And it worked.Hiawatha
S
12

My workaround was to go to C:\Users\{username}\AppData\Roaming\JetBrains\IntelliJIdea2020.3\idea64.exe vmoptions file and delete the whole content. The error disappeared and IntelliJ started normally.

Shepard answered 25/2, 2021 at 20:59 Comment(3)
Thanks a lot. Previously it was stored in ~/.IdealC20XX.X but starting from 2020 version they moved it to AppData path.Bondmaid
thank you kind person, spend an hour trying to find a solutionMacmacabre
Had the same problem with Pycharm, after deleting the vmoptions file , it workedJeraldjeraldine
O
8

Note that there are 2 .vmoptions files. There is the one in the bin directory and an override in %HOMEPATH%\IntelliJIdea\config

For me the answer was to remove -Xmx and -Xms options from the override file.

Odyssey answered 21/11, 2019 at 21:5 Comment(0)
S
6

Please check your phpstorm64.exe.vmoptions file located at bin folder and remove option

-XX:+UseG1GC

Spicer answered 7/12, 2017 at 10:41 Comment(1)
Thanks! Although this specific -XX option wasn't present, I resolved the issue by deleting vmoptions filesCantabrigian
P
6

it is not a JAVA_HOME issue, you no doubt have touched the *.vmoptions files in bin folder. if you have entered the licence sever in the *.vmpotions file, notice that it should be like this "-javaagent:C:\Program Files....." don't forget to include "-javaagent:" at the beginning of the license server ;)

Pelagian answered 16/11, 2019 at 16:38 Comment(2)
I can't find that file; where is it?Circuit
@GuillaumeF. look inside C:\Program Files\JetBrains\IntelliJ IDEA 2019.1.2\binDizzy
A
6

The file may be corrupted after a bad manipulation. Just copy and paste the idea{64}.exe.vmoptions from %IntelliJ installation path%/bin to %User IntelliJ data path%/config. For example : Copy "C:/Program Files/JetBrains/IntelliJ IDEA 2019.2.3/bin/idea64.exe.vmoptions" and paste into "C:/Users/HP/.IntelliJIdea2019.2/config"

Adviser answered 27/4, 2020 at 22:49 Comment(0)
A
2

I've been using IntelliJ for some time and this issue popped up sometime ago for me too. The issue is with a "VMOPTIONS" file. C:\Users\UserName\AppData\Roaming\NetBeans Go to this location and inside you'll find a VMOPTIONS file. Delete it. Now run the Application and it should work. This VMOPTIONS file is infact a copy of the original VMOPTION file located else where but which can also override the default VMOPTIONS. So deleting this copy with some invalid options inside fixes the problem.

If a VMOPTIONS file doesn't exist in the above path, Go to this location C:\Program Files\JetBrains\IntelliJ IDEA Community Edition xxxx.x.x\bin and run the idea.bat file. Not the exe file. This should fix any and all other problems and let you open the application with out getting that error.

Alb answered 18/10, 2020 at 12:44 Comment(0)
S
1

You might have the JRE_HOME environment variable set in your system. Remove that and try again. It generally overwrites the JAVA_HOME variable.

Schlueter answered 23/8, 2017 at 19:18 Comment(1)
I didn't have JRE_HOME variable in my environment variablesLeroy
H
1

I am just copy file "phpstorm64.exe.vmoptions" from C:\Program Files\JetBrains\PhpStorm 2019.3.1\bin and paste it(replace) in C:\Users\{{your username}}\.PhpStorm2019.3\config It works fine for me..

Homespun answered 13/1, 2020 at 7:17 Comment(0)
L
0

I got such error when adding JAVA_TOOL_OPTIONS in environment variables. Try to rename this variable to JAVA_OPTS restart IDE and rename again to JAVA_TOOL_OPTIONS. Or simply delete JAVA_TOOLS_OPTIONS if it is not required

Lorna answered 18/6, 2018 at 15:33 Comment(0)
G
0

You can find default vmoptions file of windows 64bit version of it in :

C:\Users{user}\AppData\Roaming\JetBrains\PhpStorm..\phpstorm64.exe.vmoptions

You can reinstall phpstorm as well ,it's quick.

Gena answered 2/8, 2021 at 11:16 Comment(0)
H
0

I simply removed JAVA_HOME from system variable then again added and saved.

Restart IntelliJ again. Worked fine for me.

Heaume answered 4/12, 2021 at 17:23 Comment(0)
R
0

It works fine with Webstorm

  1. JAVA_HOME. Watch this tutorial

  2. Delete .vmoptions file. It contains in:

  • C:\Program Files\WebStorm 2021.3\bin
  • C:\Users\%USER%\AppData\Roaming\JetBrains\WebStorm2021.3 OR C:\Users\%USER%\.somewhere
Remittee answered 5/12, 2021 at 11:52 Comment(0)
S
0

I had added -T 6C clean install -Dmaven.test.skip=true lines. Then I removed them, program is working now.

Solitude answered 1/11, 2022 at 6:25 Comment(0)
L
0

Please remove vmoptions file from C:\Users\username\AppData\Roaming\JetBrains\IdeaIC2021.1

It worked for me once I removed the file.

Lilybel answered 26/5, 2023 at 8:11 Comment(0)
D
0
  1. Start cmd.exe
  2. cd %APPDATA%\..\Local\Programs\IntelliJ IDEA Ultimate\bin
  3. idea.bat
  4. Output was:
    Invalid ReservedCodeCacheSize=3048M. Must be at most 2048M.
    Error: Could not create the Java Virtual Machine.
    Error: A fatal exception has occurred. Program will exit.
    
  5. Indeed, there is the environment variable ACC which contains -XX:ReservedCodeCacheSize=3048m.
  6. It turned out that %APPDATA%\..\Roaming\JetBrains\IntelliJIdea2023.3\idea64.exe.vmoptions contained that string. Changing 3048m to 2048m made IntelliJ starting again.
Discrete answered 16/2 at 9:2 Comment(0)
T
-2

try to launch idea64.exe from the cmd and see if it works

Tantrum answered 23/8, 2017 at 19:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.