Java Mac 上的 Eclipse,在尝试构建时出现“未找到指定的 VM 安装”错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4340576/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 16:09:20  来源:igfitidea点击:

Eclipse on Mac, getting "Specified VM install not found" error when trying to build

eclipseantjava

提问by cmcculloh

When I try and do an Ant build on my mac (Snow Leopard, Eclipse 3.6 - Helios) I get an error dialog that says

当我尝试在我的 mac(Snow Leopard、Eclipse 3.6 - Helios)上构建 Ant 时,我收到一个错误对话框,上面写着

"Problem Occured"
'Launching projectName build.xml' has encountered a problem. Specified VM install not found: type Standard VM, name jdk1.5.0_14

“问题发生”
'启动 projectName build.xml' 遇到问题。未找到指定的 VM 安装:类型标准 VM,名称 jdk1.5.0_14

I can't even find any preferences setting in Eclipse that specifies for it to use jdk1.5.0_14.

我什至在 Eclipse 中找不到任何指定使用 jdk1.5.0_14 的首选项设置。

When I went into my preferences and went to the Java section and looked at the Installed JREs, the only one I have specified is 1.6.0. Where is it getting the setting to try and use 1.5? (Or am I barking up the wrong tree?)

当我进入我的首选项并转到 Java 部分并查看已安装的 JRE 时,我指定的唯一一个是 1.6.0。它在哪里获得尝试使用 1.5 的设置?(或者我吠错了树?)

采纳答案by Thorbj?rn Ravn Andersen

Your ant project launcher refers for some reason to a Java 5 environment.

您的 ant 项目启动器出于某种原因指的是 Java 5 环境。

Select "Run as -> Configurations" and locate the ant build. Then indicate you want this configuration to run with a Java 6 JVM.

选择“Run as -> Configurations”并找到ant build。然后表明您希望此配置与 Java 6 JVM 一起运行。

回答by Vanchinathan Chandrasekaran

Right click on the project and choose properties. Go to Java Compiler and make sure Compiler compliance level is set to 1.6 rather than 1.5. I think that should do the trick.

右键单击项目并选择属性。转到 Java 编译器并确保编译器合规性级别设置为 1.6 而不是 1.5。我认为这应该可以解决问题。

回答by cmcculloh

There was a whole bunch of stuff I had wrong that I changed to fix this, but I believe the crucial piece was an %ATG_HOME%/home/localconfig/dasENV.shfile had an ATGJREa path that was incorrect.

有一大堆东西我错了,我改变了解决这个问题,但我相信关键部分是一个%ATG_HOME%/home/localconfig/dasENV.sh文件ATGJRE的路径不正确。

回答by Koekiebox

Delete the ".metadata.plugins\org.eclipse.debug.core.launches\ build.xml.launch"file and problem is solved".

删除 “.metadata.plugins\org.eclipse.debug.core.launches\build.xml.launch”文件,问题解决”。

回答by George

This is just an update of the previously posted solution for later versions of Eclipse, like STS.

这只是之前发布的针对 Eclipse 更高版本(如 STS)的解决方案的更新。

  1. If your Ant View is open, R-click on the root (otherwise Run -> External Tools -> External Tools Configuraitons)
  2. Run as -> External Tools Configurations ...
  3. Your Ant launch should be selected in the External Tools launchers, if not selected manually
  4. Go to the JRE tab
  5. Select Run in the same JRE as the workspace - you can also select a different JRE using the buttons on the right.
  6. Re-run your ant task(s) - this time you will not get the error message.
  1. 如果您的 Ant 视图已打开,请在根目录上单击 R 键(否则运行 -> 外部工具 -> 外部工具配置)
  2. 运行方式 -> 外部工具配置...
  3. 如果未手动选择,则应在外部工具启动器中选择您的 Ant 启动
  4. 转到 JRE 选项卡
  5. 选择在与工作区相同的 JRE 中运行 - 您也可以使用右侧的按钮选择不同的 JRE。
  6. 重新运行您的 ant 任务 - 这次您不会收到错误消息。

回答by Nitish Pandey

I kept getting "Specified VM install not found: type MacOS X VM, name Java SE 6...". And i did this accidentally and it worked: Properties-Java Compiler-Installed JREs-Search Button. It did some soul searching,created yet another JRE entry and it all worked!

我一直收到“找不到指定的 VM 安装:键入 MacOS X VM,命名 Java SE 6...”。我不小心这样做了,它起作用了:属性-Java 编译器-安装的 JREs-搜索按钮。它进行了一些灵魂搜索,创建了另一个 JRE 条目,并且一切正常!