Run Ant on Eclipse Mars with Java 1.6

前端 未结 9 1746
梦如初夏
梦如初夏 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:35

    The Java you use to run Eclipse does not have to be the same as the one you use for your projects. You must run Eclipse Mars using Java 7 (or 8) but you can use Java 6 for your projects.

    Tell Eclipse about Java 6 in the Preferences in 'Java > Installed JREs' and set that as the default (or select it in individual projects).

    0 讨论(0)
  • 2020-12-28 17:39

    add new JRE version bigger than 1.7

    0 讨论(0)
  • 2020-12-28 17:45

    I have Eclipse Oxygen running on JRE 1.8 but building some old 1.7 projects, and have jdk1.7.0_40 installed as a separate JRE and set up in the tools external config, but still got the "jre less than 1.8 not supported" error.

    What fixed it for me was just updating the build xml configuration directly, especially if you have another project which does work that you can copy from.

    Specifically, I went to the launch configurations at:

    workspace/.metadata/.plugins/org.eclipse.debug.core/.launches
    

    And edited the relevant ...build.xml.launch file, replacing:

    <booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
    <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_40"/>
    

    With:

    <booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
    <stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="jdk1.7.0_40"/>
    <stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"/>
    

    And restarted Eclipse to pick it up.

    No idea if this is moving forward or backwards in terms of Eclipse support, but it fixed my problem.

    0 讨论(0)
提交回复
热议问题