Ant is using wrong java version

前端 未结 16 1481
小蘑菇
小蘑菇 2020-11-28 09:20

I\'m using Ant 1.7.0 and installed java 1.6 which is in JAVA_HOME.

I want to build a project using java 1.5, so I\'ve exported JAVA_HOME to be my java 1.5 directory.

16条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 10:05

    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.

    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.

    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.

提交回复
热议问题