Javac in Java 10


In the Apache Ant script for Java 8 I use the following line:

<javac srcdir="${src}" classpathref="classpath" destdir="${build.bin}" compiler="javac1.8"
debug="true" debuglevel="lines,vars,source" includeantruntime="false" source="1.8" target="1.8" />

I decided to transfer the project to Java 10. Changed the specification in the script to a new version:

<javac srcdir="${src}" classpathref="classpath" destdir="${build.bin}" compiler="javac10+" 
debug="true" debuglevel="lines,vars,source" includeantruntime="false" source="10" target="10" />

But when compiling the package on this line, it gives the message:

Build.xml:65: Class not found: javac10+

Checking for the appropriate Java version before compiling is successful:

<target name="check" description="Check requirements.">
    <echo message="Verification of your JDK version."/>
    <available classname="java.util.stream.Stream" property="JDK10+.present" />
    <fail unless="JDK10+.present" message="Java 10 is required, but your version is Java ${ant.java.version}. Install latest JDK." />
</target>

Tell me where I made a mistake and how it should look like string <javac/> for Java 10?

Author: Rootware, 2018-10-10

1 answers

You need to update ant to the new version, since the support javac10+ appeared in version 1.10.2

 1
Author: Nick, 2018-10-16 10:09:42