Run Ant on Eclipse Mars with Java 1.6

2020-02-20 08:09发布

I downloaded the latest release of Eclipse (Mars) and changed the required Java version to 1.6 in eclipse.ini file as my project uses Java 1.6.

I configured installed JREs inside Eclipse to use Java 1.6. But when I try to execute my ant target it creates an error:

JRE version less than 1.7 is not supported.

Is there any workaround to use Java 1.6 in Mars version as I'm unable to upgrade to Java 1.7 at the moment?

7条回答
仙女界的扛把子
2楼-- · 2020-02-20 09:04

please take a look at the <javac>reference https://ant.apache.org/manual/Tasks/javac.html#compilervalues and add the following attributes to your <javac>-Task: compiler="javac1.6" source="1.6" target="1.6" executable="[path-to-jdk-1.6/bin/javac]" fork="true" taskname="javac1.6".

查看更多
登录 后发表回答