[英]Missing JRE in Eclipse in Mac OSX
I'm trying to run eclipse on my Mac OS X. I've been doing some Android programming on Eclipse lately, and today wanted to do some development on Java. 我正在尝试在Mac OS X上运行eclipse。最近我一直在Eclipse上进行一些Android编程,今天想在Java上进行一些开发。 However, to my surprise, Eclipse says there's no JRE/JDK installed.
但是,令我惊讶的是,Eclipse表示没有安装JRE / JDK。 I don't know how this is possible, since my android projects have worked very well so far, and even now.
我不知道这是怎么可能的,因为到目前为止,即使是现在,我的android项目也运行良好。 I've tried the following items:
我尝试了以下项目:
java version "1.8.0_20"
is installed. java version "1.8.0_20"
。 Here's the screenshot. As you can see, the Java folder just doesn't show up under Library in the above screenshot. 如您所见,Java文件夹只是没有显示在上述屏幕快照的“ 库”下。
I've gone through existing answers on SO which deal with similar problems. 我已经解决了类似问题的现有答案。 The only thing which I haven't done seems to be about setting a path variable, but they were all in Windows OS, so not sure if it applies in my situation.
我唯一没有做过的事情似乎是关于设置路径变量,但它们都在Windows OS中,因此不确定它是否适用于我的情况。
I'd really appreciate any help on this. 我真的很感谢任何帮助。
Update 1: According to what has been pointed out so far, I tried copy-pasting the suggested path. 更新1:根据到目前为止所指出的内容,我尝试复制粘贴建议的路径。 But the error I get is: The home directory does not exist.
但是我得到的错误是:主目录不存在。
Here's the screenshot: 这是屏幕截图:
You are trying to find the JRE in a wrong Library directory as Library directory maybe present in more than one place. 您正在尝试在错误的Library目录中找到JRE,因为Library目录可能存在于多个地方。 Just copy paste the jre path in 'jre home' input as
只需将jre路径复制粘贴为'jre home'输入
/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/home/contents/Home/jre/
EDIT: To find where is your java installed on Mac, run the following command: 编辑:要查找您的Java在Mac上的安装位置,请运行以下命令:
echo $(/usr/libexec/java_home)
it should return something like this: 它应该返回如下内容:
/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
append jre to the end of this path to build JRE home path: 将jre附加到此路径的末尾以构建JRE主目录路径:
/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.