contents of build.xml
<target name="compile" description="compile the source">
    <!-- Compile the Java code from ${src} into ${build} -->
    <path id="lib.path.ref">
     <fileset dir="./target/classes"/>
     <fileset dir="$USER_HOME/.m2/REPOSI~1/org/jvnet/SORCER~1\0.8\jar"/>
     <fileset dir="./target/classes"/>
    </path>
    <javac srcdir="${src}" destdir="${build}" classpath="./target/classes" 
source="1.9" target="1.9">
    <compilerarg value="--patch-module java.base=src -d 
./src/main/java/jdk/compiler/DocTree.java" />
    <classpath>
    <pathelement 
location="$USER_HOME/.m2/REPOSI~1/org/slf4j/SLF4J-~1/1.7.9/slf4j-api-1.7.9.jar"/>
    <pathelement 
location="$USER_HOME/.m2/REPOSI~1/org/jvnet/SORCER~1/0.8/sorcerer-javac-0.8.jar"/>
    <pathelement location="/Java/JDK18~1.0_1/jre/lib"/>
    <pathelement location="./target/classes"/>
    </classpath>
    </javac>

the good news is that <compilerarg> seems to be recognised by javac
the bad news is when running
>ant compile
build.xml:16: Error starting modern compiler

javac -version
9.04

ant -version
Apache Ant(TM) version 1.10.2 compiled on February 3 2018

/*the sad news is that patch-module seems to work in maven 
maven-compiler-plugin.here is pom.xml */
   <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-compiler-plugin</artifactId>
       <version>3.8.0</version>
       <configuration>
        <source>1.9</source>
        <target>1.9</target>
        <compilerargs>
        <arg>--patch-module java.base=src/main/java</arg>
        <arg>-d build ./src/main/java/jdk/compiler/DocTree.java</arg>
        </compilerargs>
       </configuration>
      </plugin>
  </target>

advice on getting --patch-module to properly configure in <javac> will be 
appreciated!
-m
<https://github.com/javapathfinder/jpf-core/issues/27>

Reply via email to