eclipse 在我的系统上安装较新版本的 JDK 后出现 ANT 脚本错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15011390/
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-09-19 20:02:42  来源:igfitidea点击:

ANT script error after installing newer version of JDK on my system

eclipseantjdk1.6

提问by Melinda

After installing the newer version of the JDK 6 (1.6.0_41) from 1.6.0_37, I went into Eclipse and updated the Installed JREs in the Java section under the preferences menu. I then went into my ANT script to test some changes I made and when I tried to run the ANT script I got this error:

从 1.6.0_37 安装较新版本的 JDK 6 (1.6.0_41) 后,我进入 Eclipse 并更新了首选项菜单下 Java 部分中的已安装 JRE。然后我进入我的 ANT 脚本来测试我所做的一些更改,当我尝试运行 ANT 脚本时,我收到了这个错误:

Specified VM install not found: type Standard VM, name jdk1.6.0_37

未找到指定的 VM 安装:类型标准 VM,名称 jdk1.6.0_37

The specified VM is not the jdk1.6.0_41. This has also been updated in the PATH and JAVA_HOME environment variables.

指定的VM 不是jdk1.6.0_41。这也已在 PATH 和 JAVA_HOME 环境变量中更新。

Any suggestions as to WHERE else to make a change so that ANT sees this?

关于在何处进行更改以便 ANT 看到这一点的任何建议?

Here is the error I'm getting:

这是我得到的错误:

enter image description here

在此处输入图片说明

Thanks.

谢谢。

回答by Melinda

After additional hunting around in Eclipse, I found in the ANT view an External Configuration Tools option when right clicking my Ant script name and under the JRE tab is where the setting was. I changed the setting to use the same JRE as the workspace and then all was fine.

在 Eclipse 中进行了额外的搜索之后,我在 ANT 视图中发现了一个外部配置工具选项,当右键单击我的 Ant 脚本名称时,JRE 选项卡下是设置所在的位置。我更改了设置以使用与工作区相同的 JRE,然后一切正常。

Just in case anyone else ran into this same problem I thought it might be helpful to post my findings.

以防万一其他人遇到同样的问题,我认为发布我的发现可能会有所帮助。

回答by Chei

Ant won't mind the new jdk version as long as its name stays unchanged under Preferences / Java / Installed JREs.

Ant 不会介意新的 jdk 版本,只要它的名称在 Preferences / Java / Installed JREs 下保持不变。