Java Eclipse:JVM 终止。退出代码=2
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25614637/
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
Eclipse: JVM terminated. Exit code=2
提问by user3362107
I recently decided to start trying Android app development, so I downloaded the Java SE Development Kit 8 (x86) for Windows (I got Windows 8 64bit, but my guide recommends getting the 32bit one), the Android SDK, and the Eclipse IDE for Java Developers (x86).
我最近决定开始尝试 Android 应用程序开发,所以我下载了适用于 Windows 的 Java SE Development Kit 8 (x86)(我有 Windows 8 64 位,但我的指南建议获得 32 位)、Android SDK 和 Eclipse IDE Java 开发人员 (x86)。
However, my Eclipse won't launch when I double click eclipse.exe! Instead, I get the following error message:
但是,当我双击 eclipse.exe 时,我的 Eclipse 不会启动!相反,我收到以下错误消息:
I tried adding Java to my Path variable in my Environment variables as suggested in some of the solutions I looked up, but it still doesn't launch properly.
我尝试按照我查找的一些解决方案中的建议将 Java 添加到我的环境变量中的 Path 变量中,但它仍然无法正常启动。
Anyone know what else I can try? Also, if possible, please do not use super-technical vocabulary as I'm new to these kinds of stuff and will not understand you...thank you haha :D
有谁知道我还能尝试什么?另外,如果可能的话,请不要使用超级技术词汇,因为我是这些东西的新手,不会理解你......谢谢哈哈:D
采纳答案by Bashir Dib
I know exactly how to solve your problem. Go to search and put in environment, a prompt will come up and ask you to "Edit environmental variables for your account" click that and a window will pop up. There will be the current paths which are running on the top (you should have your JDK version running, mine is 1.8) and on the bottom part there will be paths to choose from. Select (on the bottom part) the java path and delete it, then click okay. This should work.
我确切地知道如何解决您的问题。去搜索并放入环境,会出现提示并要求您“为您的帐户编辑环境变量”,点击它,会弹出一个窗口。将有在顶部运行的当前路径(您应该运行 JDK 版本,我的是 1.8),在底部将有可供选择的路径。选择(在底部)java 路径并删除它,然后单击确定。这应该有效。
If it didn't work, You may also add a new path to the java bin folder which worked for me.
如果它不起作用,您还可以向对我有用的 java bin 文件夹添加一个新路径。
回答by user4168310
I had the same issue and was trying to install different versions of JDK: 1.6, 1.7, 1.8.
我遇到了同样的问题,并试图安装不同版本的 JDK:1.6、1.7、1.8。
It didn't help much.
它没有多大帮助。
The problem was resolved when I changed PATH variable by removing
当我通过删除更改 PATH 变量时,问题得到解决
C:\ProgramData\Oracle\Java\javapath;
In command prompt I also ran following commands:
在命令提示符中,我还运行了以下命令:
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_25
set PATH=C:\Program Files\Java\jdk1.8.0_25\bin;%PATH%
But I think the most important was to remove C:\ProgramData\Oracle\Java\javapath;
from the PATH
.
但我认为最重要的是C:\ProgramData\Oracle\Java\javapath;
从PATH
.
回答by Justice O.
Most errors with starting eclipse happen due to multiple JRE or JDK version which makes the installer go nuts.
启动 eclipse 的大多数错误都是由于多个 JRE 或 JDK 版本而导致的,这使安装程序变得疯狂。
Solution: Go to Control Panel -> Uninstall Programs
解决方法:进入控制面板->卸载程序
If you're running 64-bit java, then uninstall all Java without the 64bit indicator. If 32-bit, then uninstall all that have 64-bit It works like magic!
如果您运行的是 64 位 Java,则卸载所有没有 64 位指示器的 Java。如果是 32 位,则卸载所有具有 64 位的它就像魔法一样!
回答by rnyunja
Here is an alternative:
As described here, make sure that you have the -vm
option set in your eclipse.ini
file.
It must be an absolute path and on 2 separate lines:
这是一个替代方案:如此处所述,请确保您-vm
在eclipse.ini
文件中设置了该选项。它必须是绝对路径并在 2 个单独的行上:
-vm
<Absolute Path>\javaw.exe
Save your .ini and relaunch Eclipse
保存您的 .ini 并重新启动 Eclipse
回答by user3916928
One line answer, remove 'C:\ProgramData\Oracle\Java\javapath;' from your path variable. It will start to work.
一行答案,删除 'C:\ProgramData\Oracle\Java\javapath;' 从你的路径变量。它将开始工作。
回答by Michael S.
What worked for me was having installed adoptopenjdk11using Chocolateypackage manager:
对我有用的是使用Chocolatey包管理器安装了Adoptopenjdk11:
choco install adoptopenjdk11
choco install adoptopenjdk11