gpt4 book ai didi

java - OSX Eclipse : No Java virtual machine was found after searching the following locations

转载 作者:行者123 更新时间:2023-12-01 06:14:17 27 4
gpt4 key购买 nike

我已经在 OSX 10.10 上安装了 Java 1.8.0.25 JDK。当尝试打开 eclipse (64Bit) 时,我收到以下错误消息:

A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse.

No Java virtual machine was found after searching the following locations: /Library/Java/JavaVirtualMachines/1.8.0.25.jdk/Contents/Home/bin/java

但是当我检查我的路径时一切正常......

export JAVA_HOME="$(/usr/libexec/java_home)"
export PATH=$PATH:$JAVA_HOME/bin
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home


$ /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home

$ /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/
Home/ MacOS/

$ /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/
bin/ db/ include/ jre/ lib/ man/

$ /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/
appletviewer jarsigner javafxpackager jcmd jhat jmc jstack keytool policytool schemagen unpack200
extcheck java javah jconsole jinfo jps jstat native2ascii rmic serialver wsgen
idlj javac javap jdb jjs jrunscript jstatd orbd rmid servertool wsimport
jar javadoc javapackager jdeps jmap jsadebugd jvisualvm pack200 rmiregistry tnameserv xjc

$ /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

$ ls /usr/bin/java
lrwxr-xr-x 1 root wheel 73B 11 Nov 16:56 /usr/bin/java -> /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java

$ "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

我还按照许多其他线程中的建议编辑了(添加了 -vm 选项)eclipse.ini:

...
--launcher.defaultAction
openFile
-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
-vmargs
...

但是没有任何效果,我仍然收到上述消息。有人知道如何解决这个问题吗?

最佳答案

安装新的 jdk(并删除旧的 jdk)后我遇到了同样的问题。解决方案是修复 eclipse.ini

中 vm 的路径

另请参见 ENV 变量 $JAVA_HOME/usr/libexec/java_home

关于java - OSX Eclipse : No Java virtual machine was found after searching the following locations,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28021147/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com