JVM terminated. Exit code=2
/usr/local/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.2.0.dist.jar
-os linux
-ws gtk
-arch x86_64
-showsplash
-launcher /usr/lib/eclipse/eclipse
-name Eclipse
--launcher.library /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.dist/eclipse_1408.so
-startup /usr/lib/eclipse//plugins/org.eclipse.equinox.launcher_1.2.0.dist.jar
--launcher.overrideVmargs
-exitdata 428003
-clean
-initialize
-vm /usr/local/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.2.0.dist.jar
所以 java -version 找不到路径。我尝试了以下方法:编辑 ~/.bashrc ~/.profile /etc/environment bash.bashrc 文件并向其中添加以下内容
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_15
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
JRE_HOME=/usr/lib/jvm/jre1.7.0_15
PATH=$PATH:$HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
另外,我还手动将 java bin 目录添加到 PATH 中。我已经重新启动了我的电脑几次,但我仍然得到
bash: /usr/local/bin/java: No such file or directory