Java intellij idea 无法创建JVM 错误代码-1
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/45846624/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
intellij idea failed to create JVM error code -1
提问by omidXxX
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:
我安装了intellij-idea。虽然我已经设置了引用“C:\Program Files\Java\jdk1.8.0_45”的 JAVA_HOME 环境变量,但是当我尝试运行它时,我最终遇到了以下错误:
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
Windows 7_ 64 位
回答by Elad Shamailov
try to launch idea64.exe from the cmd and see if it works
尝试从cmd启动idea64.exe,看看它是否有效
回答by alirabiee
You might have the JRE_HOME environment variable set in your system. Remove that and try again. It generally overwrites the JAVA_HOME variable.
您可能在系统中设置了 JRE_HOME 环境变量。删除它并重试。它通常会覆盖 JAVA_HOME 变量。
回答by joseantgv
Please check your phpstorm64.exe.vmoptions
file located at bin
folder and remove option
请检查phpstorm64.exe.vmoptions
位于bin
文件夹中的文件并删除选项
-XX:+UseG1GC
-XX:+UseG1GC
回答by Valeriy K.
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
在环境变量中添加 JAVA_TOOL_OPTIONS 时出现这样的错误。尝试将此变量重命名为 JAVA_OPTS 重新启动 IDE 并再次重命名为 JAVA_TOOL_OPTIONS。或者如果不需要,只需删除 JAVA_TOOLS_OPTIONS
回答by Mohsen Alizadeh
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 ;)
这不是 JAVA_HOME 问题,您无疑已经触及了 bin 文件夹中的 *.vmoptions 文件。如果您在 *.vmpotions 文件中输入了许可证服务器,请注意它应该是这样的“-javaagent:C:\Program Files.....” 不要忘记在开头包含“-javaagent:”许可证服务器 ;)
回答by GMauro
Note that there are 2 .vmoptions files. There is the one in the bin directory and an override in %HOMEPATH%\IntelliJIdea\config
请注意,有 2 个 .vmoptions 文件。在 bin 目录中有一个,在 %HOMEPATH%\IntelliJIdea\config 中有一个覆盖
For me the answer was to remove -Xmx and -Xms options from the override file.
对我来说,答案是从覆盖文件中删除 -Xmx 和 -Xms 选项。
回答by Feisal Aswad
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..
我只是从 C:\Program Files\JetBrains\PhpStorm 2019.3.1\bin 复制文件“phpstorm64.exe.vmoptions”并将其粘贴(替换)到 C:\Users\{{your username}}\.PhpStorm2019.3 \config 它对我来说很好用..
回答by Abdoul Hamid COULIBALY
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"
错误操作后文件可能会损坏。只需将想法{64}.exe.vmoptions 从%IntelliJ 安装路径%/bin 复制并粘贴到%User IntelliJ 数据路径%/config。例如:复制“C:/Program Files/JetBrains/IntelliJ IDEA 2019.2.3/bin/idea64.exe.vmoptions”并粘贴到“C:/Users/HP/.IntelliJIdea2019.2/config”