简体   繁体   English

Eclipse - Mac Os 默认 JRE 丢失

[英]Eclipse - Mac Os Default JRE missing

The list of installed JRE's is empty, when I click "add" the only options I'm given are - Execution Environment Description, Standard 1.1.x VM, Standard VM.已安装的 JRE 列表是空的,当我单击“添加”时,我给出的唯一选项是 - 执行环境描述、标准 1.1.x VM、标准 VM。

There's no option for a MacOS Default JRE and choosing standard VM results in the usual "Standard VM not supported on MacOS". MacOS 默认 JRE 没有选项,选择标准 VM 会导致通常的“MacOS 不支持标准 VM”。

Eclipse Galileo, Mac OS X 10.5.8. Eclipse 伽利略,Mac OS X 10.5.8。

Any suggestions much appreciated任何建议非常感谢

I just had the same problem and I was able to fix it.我只是遇到了同样的问题,我能够解决它。 I had installed Eclipse for PHP (PDT) because I couldn't get PDT to work with Eclipse classic.我已经为 PHP (PDT) 安装了 Eclipse,因为我无法让 PDT 与 Eclipse classic 一起使用。 I then found out that with the new install, Java files won't run!然后我发现使用新安装,Java 文件将无法运行! But there's a simple solution:但是有一个简单的解决方案:

Go to Help->Install New Software...转到帮助-> 安装新软件...

Select:选择:

Galileo - http://download.eclipse.org/releases/galileo伽利略 - http://download.eclipse.org/releases/galileo

Under Programming Languages choose:在编程语言下选择:

Eclipse Java Development Tools 3.5.1.r351_v20090810-0600-7r88FEoFI0WTo6Az-1qFRHm37ChJ Eclipse Java 开发工具 3.5.1.r351_v20090810-0600-7r88FEoFI0WTo6Az-1qFRHm37ChJ

Install and you'll find your JREs!安装,您将找到您的 JRE!

1) Follow Joshua's answer: "Help->Install New Software... Select: Galileo - http://download.eclipse.org/releases/galileo Under Programming Languages choose: Eclipse Java Development Tools 3.5.x..." 1) 按照 Joshua 的回答:“Help->Install New Software... 选择:Galileo - http://download.eclipse.org/releases/galileo在 Programming Languages 下选择:Eclipse Java Development Tools 3.5.x...”

2) Then go to Eclipse -> Preferences -> Java -> Installed JREs. 2) 然后去 Eclipse -> Preferences -> Java -> Installed JREs。

3) Click ADD. 3) 点击添加。

4) Under 'Installed JRE Types" you should see the previously missing "MacOS X VM". Select this and click NEXT. 4) 在“已安装的 JRE 类型”下,您应该会看到以前缺少的“MacOS X VM”。选择它并单击下一步。

5) Click the BROWSE button next to the JRE home field, and the dialog box should say "Select the root directory of the JRE installation" 5)点击JRE主页旁边的BROWSE按钮,对话框应该是“选择JRE安装的根目录”

6) Browse to /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home 6) 浏览到 /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home

7) Click OPEN. 7) 点击打开。

8) In the JRE name field type "JVM 1.5" 8) 在 JRE 名称字段中键入“JVM 1.5”

9) From there you should just be able to click FINISH and have your JRE available. 9) 从那里你应该能够点击完成并让你的 JRE 可用。

I used this to fix a missing JRE error building a Google App Engine project.我用它来修复构建 Google App Engine 项目时丢失的 JRE 错误。

The "Standard VM not supported on MacOS" message has been seen since eclipse3.3 (2006!).自 eclipse3.3 (2006!) 以来,已出现“MacOS 不支持标准 VM”消息。

The bug 156343 reports it fixed in the... eclipse3.6M2 ( Helios , M2 released in September 2009 , final version to be released in June 2010)Bug 156343报告它已在... eclipse3.6M2 中修复( Helios ,M2 于 2009 年 9 月发布,最终版本将于 2010 年 6 月发布)


If there is no JVM at all, try to specify one explicitly in the eclipse.ini (like the one I propose , except I use Windows-like path), and see if there is still no JVM proposed in this list after restart.如果根本没有JVM,尝试在eclipse.ini中明确指定一个(就像我建议的那个,除了我使用类似Windows的路径),然后重新启动后查看此列表中是否仍然没有建议的JVM。
Check that also with Helios3.6M3 (latest Milestone currently available, and check if all the issue is still there.也可以使用Helios3.6M3 (当前可用的最新里程碑,并检查所有问题是否仍然存在)进行检查。


A current workaround (that is, if a default VM was there in the first place) would be to, for example for a JDK like the JRockit one:当前的解决方法(即,如果首先存在默认 VM)将是,例如对于像 JRockit 这样的 JDK:

add the JRockit VM's jars as libraries.将 JRockit VM 的 jars 添加为库。
The Mac's classes will take precedence (since they're on the boot classpath) but you'll also be able to see any specifics in the Jar of the attached bundle. Mac 的类将优先(因为它们在引导类路径上),但您也可以在附加包的 Jar 中看到任何细节。

To keep JDT sane, you should probably ensure that the Mac's VM comes first in the .classpath though ...为了让 JDT 保持理智,您可能应该确保 Mac 的 VM 在.classpath中排在第一位...


The 3.6M2 will authorize this, for instance: 3.6M2 将对此进行授权,例如:

已安装的 JRE

I updated my java version to 11 and my Spring Boot project in eclipse also crashed.我将我的 java 版本更新为 11,我在 eclipse 中的 Spring Boot 项目也崩溃了。 Here's how I fixed this:这是我解决这个问题的方法:

(Eclipse will find the JRE path for you) (Eclipse 会为你找到 JRE 路径)

  1. Eclipse -> Preferences -> Java -> Installed JREs Eclipse -> 首选项 -> Java -> 已安装的 JRE
  2. Click on the Search button on the right and it will direct you to updated JREs.单击右侧的“搜索”按钮,它将引导您找到更新的 JRE。
  3. Select Newly Updated JRE and apply changes.选择新更新的 JRE 并应用更改。

Screenshot of Eclipse -> Preferences -> Java -> Installed JREs Eclipse -> Preferences -> Java -> Installed JREs 的屏幕截图

Screenshot of Eclipse -> Finding JRE Path Eclipse -> 查找 JRE 路径的屏幕截图

Screenshot of Eclipse -> Selecting JRE Path Eclipse -> 选择 JRE 路径的屏幕截图

You have an "add" button in there which lets you add a new JVM.您在那里有一个“添加”按钮,可以让您添加新的 JVM。 In fact, there should even be a "look for JVMs" button.事实上,甚至应该有一个“查找 JVM”按钮。

If you really don't have one handy, just download a JDK from Sun and then use add to add it to your list of JVMs, and set it to be the default.如果您真的没有,只需从 Sun 下载一个 JDK,然后使用add 将其添加到您的 JVM 列表中,并将其设置为默认值。

I'm not sure what exactly your question is...我不确定你的问题到底是什么......

If you want to know where the JVM/JDK resides on Mac OS X, the various versions can be found in /System/Library/Frameworks/JavaVM.framework/Versions .如果您想知道 JVM/JDK 在 Mac OS X 上的位置,可以在/System/Library/Frameworks/JavaVM.framework/Versions找到各种版本。 Just add one of these to Eclipse.只需将其中之一添加到 Eclipse。

如果您想要 OSX 的内置 JVM,那么您可以将其添加为 Mac OSX VM,否则 VonC 的注释会告诉您该怎么做。

I had this exact problem with the same version of Eclipse and Mac OS X. A minor detail note, it was the PHP version of Eclipse.我在使用相同版本的 Eclipse 和 Mac OS X 时遇到了这个问题。一个小细节说明,它是 Eclipse 的 PHP 版本。 I couldn't determine a resolution within Eclipse, but downloading the normal version of Eclipse yielded the ability to select the Mac VM.我无法确定 Eclipse 中的分辨率,但下载普通版本的 Eclipse 可以选择 Mac VM。

Eclipse Mars日食火星

Eclipse Market Place -> Type "Java" and install " Java 8 support for Eclipse Kepler SR2 " Eclipse Market Place -> 输入“Java”并安装“ Java 8 support for Eclipse Kepler SR2

Java 8 对 Eclipse Kepler SR2 的支持

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM