Eclipse 不启动 (Ubuntu):JVM 终止。退出代码=2

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26736164/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 22:10:37  来源:igfitidea点击:

Eclipse does not launch (Ubuntu) : JVM terminated. Exit code=2

javaandroideclipseubuntuenvironment-variables

提问by Nirav Mehta

  1. I install ubuntu 14.04 LTS (64bit)
  2. After that Install Eclipse Luno Standard for 64bit
  3. Install Jdk and follow all the step for setting jdk using following link,

    http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux

  4. Then After I enable to start my eclipse it giving me a following Error,

    VM terminated. Exit code=2

     /usr/bin/java
     -Dosgi.requiredJavaVersion=1.6
     -XX:MaxPermSize=256m
     -Xms256m
     -Xmx1024m
     -jar   /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415- 2008.jar
     -os linux
     -ws gtk
     -arch x86_64
     -showsplash  /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.platform_4.4.0.v20140925- 0400/splash.bmp
     -launcher /home/eheuristic/Ecclipse/eclipse/eclipse
     -name Eclipse
     --launcher.library  /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1. 200.v20140603-1326/eclipse_1605.so
     -startup /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
    --launcher.appendVmargs
    -exitdata 208017
    -product org.eclipse.epp.package.java.product
    -vm /usr/bin/java
    -vmargs
    -Dosgi.requiredJavaVersion=1.6
    -XX:MaxPermSize=256m
    -Xms256m
    -Xmx1024m
    -jar  /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar 
    
  1. 我安装了 ubuntu 14.04 LTS(64 位)
  2. 之后安装 Eclipse Luno Standard for 64bit
  3. 安装 Jdk 并按照以下链接设置 jdk 的所有步骤,

    http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux

  4. 然后在我启用开始我的日食后,它给了我以下错误,

    虚拟机终止。退出代码=2

     /usr/bin/java
     -Dosgi.requiredJavaVersion=1.6
     -XX:MaxPermSize=256m
     -Xms256m
     -Xmx1024m
     -jar   /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415- 2008.jar
     -os linux
     -ws gtk
     -arch x86_64
     -showsplash  /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.platform_4.4.0.v20140925- 0400/splash.bmp
     -launcher /home/eheuristic/Ecclipse/eclipse/eclipse
     -name Eclipse
     --launcher.library  /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1. 200.v20140603-1326/eclipse_1605.so
     -startup /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
    --launcher.appendVmargs
    -exitdata 208017
    -product org.eclipse.epp.package.java.product
    -vm /usr/bin/java
    -vmargs
    -Dosgi.requiredJavaVersion=1.6
    -XX:MaxPermSize=256m
    -Xms256m
    -Xmx1024m
    -jar  /home/eheuristic/Ecclipse/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar 
    

I so much try to solve setting Environment variable but can't do, help me one suggest to how to solve it.

我非常尝试解决设置环境变量的问题,但无法做到,请帮我建议如何解决它。

采纳答案by Nirav Mehta

I find my Stupid Solution ,

我找到了我的愚蠢解决方案,

I trying install jdk that is support for 32 bit.

我尝试安装支持 32 位的 jdk。

I downloads new jdk1.8.0_25 for 64 bitand follow the step, i got solutions.

我下载了新的 64 位 jdk1.8.0_25并按照步骤操作,我得到了解决方案。

回答by Elliott Frisch

First, I strongly recommend you use the webupd8 ppa

首先,我强烈建议您使用 webupd8 ppa

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Then to set it

然后设置它

sudo update-java-alternatives -s java-8-oracle 

The advantage is ease of updates.

优点是易于更新。

回答by Kishore

write in eclipse.in on the top of the file

在 eclipse.in 中写入文件顶部

-startu
-vm
/usr/local/jdk/jre/bin  

change path according to your system

根据您的系统更改路径

回答by nwaweru

Had the same error. Solved it by:

有同样的错误。通过以下方式解决:

sudo update-alternatives --config java

须藤更新替代品--config java

I started "using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java to provide /usr/bin/java (java) in manual mode" - that was option 4, and it worked fine.

我开始“使用 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 在手动模式下提供 /usr/bin/java (java)”——这是选项 4,它运行良好。

I am using Luna Service Release 2 (4.4.2).

我正在使用 Luna 服务版本 2 (4.4.2)。

Hope it helps someone somewhere.

希望它可以帮助某人某处。

回答by Kshitij Kulshrestha

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 too choose from. select (on the bottom part) the java path and delete it, then click okay. it should work

我知道如何解决你的问题,去搜索并放入环境,会出现一个提示,要求你“为你的帐户编辑环境变量”,点击它,会弹出一个窗口。将有在顶部运行的当前路径(你应该让你的 jdk 版本运行我的是 1.8),在底部也会有路径可供选择。选择(在底部)java 路径并删除它,然后单击确定。它应该工作

回答by Flavio Luiz Cruz

I had this same problem when trying to run Eclipse and Android Studio on Ubuntu with Java 9 . Solution: Install Java 8

尝试在带有 Java 9 的 Ubuntu 上运行 Eclipse 和 Android Studio 时,我遇到了同样的问题。解决方案:安装 Java 8

sudo apt-get install oracle-java8-installer
并将其设置为默认值

sudo apt-get install oracle-java8-set-default

and voilà.

瞧。