Hi Alan,

Following the recipe at [2], it all seems to work.

After modularizing the SLF4J project under Java9/Maven I tried to have
the project compile for Java 6 (except modules-info.java) and have
modules-info.java compile with Java 9.

Trying a MR-JAR approach, I got very confused when I could not get the
project to compile even with "javac" let alone Maven.

My mental fog miraculously dissipated after reading [1], in particular
the following lines in that email:

javac --release 8 -d target/classes src/main/java/com/example/A.java \
   src/main/java/com/example/Version.java
javac -d target/classes src/main/java/module-info.java

Again, the recipe from [2] was helpful but not as helpful as the two
lines above.


--
Ceki

[1] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2017-February/011306.html [2] https://maven.apache.org/plugins/maven-compiler-plugin/examples/module-info.html

On 25.03.2017 09:15, Alan Bateman wrote:

On 25/03/2017 08:04, Ceki Gülcü wrote:
:

Right, project code does not have anything Java9 specific except
module-info.class.

So if I understand correctly, source code except module-info.java
would need to be compiled targeting an older java version, say 1.6,
and module-info.java would be compiled targeting Java 9, everything
placed at their usual non-MR-JAR destinations.

Yes. The Apache Maven Compiler Plugin also has a page with a recipe [1]
that might be useful.

-Alan

[1]
https://maven.apache.org/plugins/maven-compiler-plugin/examples/module-info.html

Reply via email to