简体   繁体   English

Eclipse 3.7,Ant,Java 1.7

[英]Eclipse 3.7, Ant, Java 1.7

I went through and uninstalled all Java from my computer. 我经历并从我的计算机上卸载了所有Java。 Then I installed JavaSE JDK1.7. 然后我安装了JavaSE JDK1.7。 I then modified Eclipse configuration so it would start and opened it up. 然后,我修改了Eclipse配置,以便启动并打开它。 I have an Ant script to build my project and I want to build my project against 1.7, but whenever I run the script, it says 我有一个Ant脚本来构建我的项目,我想针对1.7构建我的项目,但每当我运行脚本时,它说

'Launching PROJECT build.xml' has encountered a problem.

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

The installed JRE in Eclipse is 1.7 and nothing else. Eclipse中安装的JRE是1.7,没有别的。 I cannot for the life of me find how to change what Ant is looking for. 我不能为我的生活找到如何改变Ant正在寻找的东西。

This is because you still have the old JDK configured as JRE in the External Tools Configuration" in eclipse - open it via the arrow menu next to this button in the toolbar: 这是因为你仍然在Eclipse中的外部工具配置中将旧的JDK配置为JRE - 通过工具栏中此按钮旁边的箭头菜单打开它: 在此输入图像描述 , then change it to the Java 7 JDK. ,然后将其更改为Java 7 JDK。

In Eclipse, click the ant file -- Run As -- External Tools Configuration and click on the JRE tab. 在Eclipse中,单击ant文件 - Run As - External Tools Configuration并单击JRE选项卡。

Select "Run in the same JRE as the workspace" 选择“在与工作区相同的JRE中运行”

Delete the "C:\\Users\\%USERNAME%\\workspace.metadata.plugins\\org.eclipse.debug.core.launches\\%PROJECT_NAME% build.xml.launch file" 删除“C:\\ Users \\%USERNAME%\\ workspace.metadata.plugins \\ org.eclipse.debug.core.launches \\%PROJECT_NAME%build.xml.launch”

That solved problem for me. 这解决了我的问题。

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

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