在Linux上查找Eclipse的Java VM

时间:2014-01-27 23:34:16

标签: java linux eclipse

我刚刚搬到Linux并开始使用Ubuntu但是它很难尝试 运行Eclipse IDE。 我下载了JDK和Eclipse的64位版本并将文件解压缩到 我的'Documents'文件夹。我知道我需要手动选择java vm的路径 执行eclipse,但我不能让它工作:

我先试了这个:

./eclipse -vm /home/lucasamura/Documents/jdk1.7.0_51/bin/java

我收到了这个错误:

JVM terminated. Exit code=2 /home/lucasamura/Documents/jdk1.7.0_51/bin/java
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
-jar /home/lucasamura/Documents/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
-os linux
-ws gtk
-arch x86_64
-showsplash /home/lucasamura/Documents/eclipse//plugins/org.eclipse.platform_4.3.1.v20130911-1000/splash.bmp
-launcher /home/lucasamura/Documents/eclipse/eclipse
-name Eclipse
--launcher.library /home/lucasamura/Documents/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20130807-1835/eclipse_1506.so
-startup /home/lucasamura/Documents/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.appendVmargs
-exitdata 34800b
-product org.eclipse.epp.package.java.product
-vm /home/lucasamura/Documents/jdk1.7.0_51/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
-jar /home/lucasamura/Documents/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar

终端还显示了两个错误:

Error: could not find libjava.so 
Error: Could not find Java SE Runtime Enviroment   

所以我决定尝试在jdk文件夹中使用jre的路径:

./eclipse -vm /home/lucasamura/Documents/jdk1.7.0_51/jre/bin/java

但后来我得到了“奖励”以下内容:

JVM terminated. Exit code=127 /home/lucasamura/Documents/jdk1.7.0_51/jre/bin/java
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
-jar /home/lucasamura/Documents/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
-os linux
-ws gtk
-arch x86_64
-showsplash /home/lucasamura/Documents/eclipse//plugins/org.eclipse.platform_4.3.1.v20130911-1000/splash.bmp
-launcher /home/lucasamura/Documents/eclipse/eclipse
-name Eclipse
--launcher.library /home/lucasamura/Documents/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20130807-1835/eclipse_1506.so
-startup /home/lucasamura/Documents/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.appendVmargs
-exitdata 35800b
-product org.eclipse.epp.package.java.product
-vm /home/lucasamura/Documents/jdk1.7.0_51/jre/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
-jar /home/lucasamura/Documents/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar

这在终端上:

libraries: libjli.so: cannot open shared object file: No such file or directory

关于我可能做错的任何想法?

1 个答案:

答案 0 :(得分:2)

我建议您使用apt来安装java,并省去一些麻烦。

默认情况下,OpenJDK可用。

此处提供了Oracle JDK的PPA:https://launchpad.net/~webupd8team/+archive/java