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

omidXxX
  • 147
  • 1
  • 1
  • 9

15 Answers15

11

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.

theomeli
  • 390
  • 4
  • 14
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.

GMauro
  • 111
  • 1
  • 3
6

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

-XX:+UseG1GC

joseantgv
  • 1,943
  • 1
  • 26
  • 34
  • 2
    Thanks! Although this specific -XX option wasn't present, I resolved the issue by deleting vmoptions files – Mark Sep 05 '18 at 13:25
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 ;)

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"

Bamanan
  • 96
  • 1
  • 3
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.

Dharman
  • 30,962
  • 25
  • 85
  • 135
iWiiCK
  • 361
  • 5
  • 13
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.

alirabiee
  • 1,286
  • 7
  • 14
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..

Feisal Aswad
  • 365
  • 3
  • 9
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

Valeriy K.
  • 2,616
  • 1
  • 30
  • 53
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.

Hesam Moosapour
  • 510
  • 5
  • 12
0

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

Restart IntelliJ again. Worked fine for me.

Suman
  • 529
  • 2
  • 5
  • 20
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
Sofit
  • 1
  • 1
0

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

wonka
  • 33
  • 4
0

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

It worked for me once I removed the file.

-2

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