Run Ant on Eclipse Mars with Java 1.6

前端 未结 9 1859
梦如初夏
梦如初夏 2020-12-28 16:59

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 installe

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-28 17:34

    I recently ran into this issue with Java 8 being on my machine, using Elicpse Oxygen and trying to use Ant to build a Java 6 project. I used some suggestions above but also encountered some strange behavior during the Ant build process. In the end it worked, here were my steps:

    1) Java home ended up staying pointed to Java 8.

    2) Set in the Ant script the values suggested by @Chris.

    3) Do not change the Ant Runtime JRE, mine was left at 8, and in fact would not run the Ant build if I changed it to 6...

    4) Project settings build path and compiler levels were all set to 6.

    5) Run the build.

    This produces a build at the Java 6 level that worked for me.

提交回复
热议问题