eclipseant

Running ant tasks in eclipse with Java 1.8 lead to "JRE version less than 11 is not supported. "


With eclipse I get the following error when I execute an ant task with Java 1.8.

JRE version less than 11 is not supported.

My "external tool configuration" is configured with "Seperate JRE" Eclipse Adoptium jdk-8.0.352.8-hotspot

Anybody knows how to prevent this restriction?


Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components) Version: 2022-12 (4.26.0) Build id: 20221201-1913


Solution

  • Got it running.

    Adding source and target with 1.8 did the trick for me in build.xml

      <JAVAC destdir="${build.classes.test}" source="1.8" target="1.8">
            <src path="${src.test}" />
    

    Afterwards I checked with javap -v MyStuff.class and saw Output major version: 52 which is 1.8

    More background

    Here are bugs describing the situation:

    Further issues