Eclipse 启动时崩溃 - JVM 终止。退出代码=2
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17198889/
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 Crash on Launch - JVM terminated. Exit code=2
提问by Marcin K.
I will do my best to make my situation as clear as possible. I tried googling the error message, but I haven't found any topic regarding exit code=2
anywhere. I only found topics regarding different exit codes, and I'm trying to fix my issue following the advice given there - no luck so far. Also I'm a newbie when it comes to any form of Linux (the distribution I'm using is Ubuntu).
我会尽我所能,尽可能清楚地说明我的情况。我尝试谷歌搜索错误消息,但我没有找到任何关于exit code=2
任何地方的主题。我只找到了有关不同退出代码的主题,我正在尝试按照那里给出的建议解决我的问题 - 到目前为止没有运气。另外,当涉及到任何形式的 Linux(我使用的发行版是 Ubuntu)时,我还是个新手。
Problem:
问题:
My eclipse crashes on launch with following error window popping up:
我的 Eclipse 在启动时崩溃,并弹出以下错误窗口:
JVM terminated. Exit code=2
/usr/bin/java
-Xms40m
-Xmx384m
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=/usr/share/eclipse/dropins
-jar /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.dist.jar
-os linux
-ws gtk
-arch x86_64
-showsplash /usr/lib/eclipse//plugins/org.eclipse.platform_3.8.1.dist/splash.bmp
-launcher /usr/lib/eclipse/eclipse
-name Eclipse
--launcher.library/usr/lib/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.dist/eclipse_1503.so
-startup /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.dist.jar
--launcher.overrideVmargs
-exitdata 670018
-vm /usr/bin/java
-vmargs
-Xms40m
-Xmx384m
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=/usr/share/eclipse/dropins
-jar /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.dist.jar
There is a big posibility that my problem is related to lack of proper Java version installed.
我的问题很可能与未安装正确的 Java 版本有关。
I suspect this because:
我怀疑这是因为:
I had eclipse running on my pc two days ago. Yesterday I had to use a web-application which required a specific version of JRE installed. Due to my lack of linux knowledge, I spent a few hours removing my current installations of java JREs and JDKs (so I could install the required version) using multiple guides that I found on the internet (some included commands like sudo apt-get purge java*
and other commands including removing, java and *). Today my Eclipse wont launch.
两天前我在我的电脑上运行了 eclipse。昨天我不得不使用一个需要安装特定版本的 JRE 的网络应用程序。由于我缺乏 linux 知识,我花了几个小时使用我在互联网上找到的多个指南(一些包括命令sudo apt-get purge java*
和其他命令,包括删除、java 和 *)。今天我的 Eclipse 无法启动。
When I run
当我跑
java -version
it says no such file or directory, but the webpages like http://www.java.com/en/download/testjava.jsphttp://javatester.org/version.htmldo work and say that my java version is
它说没有这样的文件或目录,但是像http://www.java.com/en/download/testjava.jsp http://javatester.org/version.html这样的网页 可以工作并说我的 java 版本是
Vendor: Oracle Corporation
Version: Java SE 7 Update 25
Operating System: Linux 3.5.0-34-generic
Java Architecture: 64-bit
installed using this method:
使用此方法安装:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Can someone please guide me how to solve this specific problem? Luckly I haven't made any important projects in my Eclipse yet so I don't mind purging the installation if necessary.
有人可以指导我如何解决这个特定问题吗?幸运的是,我还没有在我的 Eclipse 中创建任何重要的项目,所以我不介意在必要时清除安装。
To be completely honest the main reason I need Eclipse for is the Remote Server Explorer option, so if anyone knows a good IDE other than Eclipse that can provide just as good Remote Server Explorer it would be a perfect-fast-temporary solution.
老实说,我需要 Eclipse 的主要原因是远程服务器资源管理器选项,所以如果有人知道 Eclipse 之外的一个好的 IDE 可以提供同样好的远程服务器资源管理器,这将是一个完美的快速临时解决方案。
回答by Pau
I got the same error message and solved it by starting eclipse with the -clean parameter. To use the clean parameter: Edit the eclipse.ini file located in your Eclipse install directory and insert -clean as the first line. Once started, remove the -clean parameter in the eclipse.ini file.
我收到了相同的错误消息,并通过使用 -clean 参数启动 eclipse 来解决它。要使用 clean 参数: 编辑位于 Eclipse 安装目录中的 eclipse.ini 文件并插入 -clean 作为第一行。启动后,删除 eclipse.ini 文件中的 -clean 参数。
It worked for me...
它对我有用...
回答by Selvaganesan Saminathan
Set\Change your current jdk path in eclipse.ini.
在 eclipse.ini 中设置\更改您当前的 jdk 路径。
-vm
C:\Java\JDK.8\bin\javaw.exe
Sample Ini file contents:
示例 Ini 文件内容:
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\Java\JDK.8\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx1024m
回答by mvm_bgm
In the environment variables check the value of Path variable, it would have reference to the Oracle javapath which would be incorrect java version and may cause the issue. just remove "C:\ProgramData\Oracle\Java\javapath;" from the Path variable and try.
在环境变量中检查 Path 变量的值,它会引用 Oracle javapath,这将是不正确的 java 版本并可能导致问题。只需删除“C:\ProgramData\Oracle\Java\javapath;” 从 Path 变量并尝试。
回答by anitha
The following environment variables were removed and the Connect client was able to successfully launch:
删除了以下环境变量并且 Connect 客户端能够成功启动:
_JAVA_OPTIONS JAVA_TOOL_OPTIONS IBM_JAVA_OPTIONS
_JAVA_OPTIONS JAVA_TOOL_OPTIONS IBM_JAVA_OPTIONS
The operating system environment variables can be found by:
可以通过以下方式找到操作系统环境变量:
From Desktop, right-click on My Computer icon-> Properties -> Advanced.
Click the Environment variables button to remove the before-mentioned system environment variables.
回答by sunny522
We need to delete all the content in the folder specified in the error msg.Please go through the link below for example JVM Terminated
我们需要删除错误消息中指定的文件夹中的所有内容。请通过下面的链接例如JVM Terminated