问题描述
我使用蚂蚁1.7.0和安装的Java 1.6这是JAVA_HOME。
I'm using Ant 1.7.0 and installed java 1.6 which is in JAVA_HOME.
我要建立使用Java 1.5的一个项目,所以我出口JAVA_HOME是我的Java 1.5目录。
I want to build a project using java 1.5, so I've exported JAVA_HOME to be my java 1.5 directory.
java -version
说:1.5。当我运行Ant是使用Java 1.6。
says "1.5". When I run Ant it uses java 1.6.
推荐答案
刚把这个问题,它发生了,因为我第一次添加的构建文件蚂蚁视图时的默认JRE为1.6。
Just had this issue, it happened because I'd first added the build file to the ant-view when the default JRE was 1.6.
有没有具体项目的JRE和我改变了默认为1.5,即使蚀是在1.5运行,并且JAVA_HOME是1.5了。从运行使用JRE 1.5命令行Ant目标,但是Eclipse中它仍然使用1.6。
There was no project-specific JRE and I changed the default to 1.5, even eclipse was running in 1.5, and JAVA_HOME was 1.5 too. Running the ant target from the command line used JRE 1.5, but within eclipse it still used 1.6.
我不得不用鼠标右键单击Ant目标,选择Run As ...和JRE选项卡下更改JRE。此设置记住后续运行。
I had to right-click the ant target, select Run As... and change the JRE under the JRE tab. This setting is remembered for subsequent runs.
这篇关于蚂蚁是用错了Java版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!