JDK9 source and target version must be set to 1.6+ [1] and the file
tools.jar has been removed due to the Jigsaw project [2].

The patch (attached and bellow) fix this, enabling jspc to be build
using JDK9 and removing the jspc-maven-plugin assert for tools.jar
when it is run using JDK9.

Regards,
Tiago Daitx

[1] http://mail.openjdk.java.net/pipermail/hotspot-dev/2014-July/014595.html
[2] http://mreinhold.org/blog/jigsaw-modular-images
-- 
Tiago Sturmer Daitx
tda...@gmail.com


Index: 
jspc-maven-plugin/src/main/groovy/org/codehaus/mojo/jspc/CompilationMojoSupport.groovy
===================================================================
--- 
jspc-maven-plugin/src/main/groovy/org/codehaus/mojo/jspc/CompilationMojoSupport.groovy
(revision 20412)
+++ 
jspc-maven-plugin/src/main/groovy/org/codehaus/mojo/jspc/CompilationMojoSupport.groovy
(working copy)
@@ -335,7 +335,9 @@
         // JspC needs URLClassLoader, with tools.jar
         def parent = Thread.currentThread().contextClassLoader
         def cl = new JspcMojoClassLoader(parent)
-        cl.addURL(findToolsJar().toURI().toURL())
+        if (Double.parseDouble(SystemUtils.JAVA_SPECIFICATION_VERSION) < 1.9) {
+            cl.addURL(findToolsJar().toURI().toURL())
+        }
         Thread.currentThread().setContextClassLoader(cl)

         try {
Index: pom.xml
===================================================================
--- pom.xml (revision 20412)
+++ pom.xml (working copy)
@@ -296,8 +296,8 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
-                    <source>1.4</source>
-                    <target>1.4</target>
+                    <source>1.6</source>
+                    <target>1.6</target>
                 </configuration>
             </plugin>
Index: jspc-maven-plugin/src/main/groovy/org/codehaus/mojo/jspc/CompilationMojoSupport.groovy
===================================================================
--- jspc-maven-plugin/src/main/groovy/org/codehaus/mojo/jspc/CompilationMojoSupport.groovy	(revision 20412)
+++ jspc-maven-plugin/src/main/groovy/org/codehaus/mojo/jspc/CompilationMojoSupport.groovy	(working copy)
@@ -335,7 +335,9 @@
         // JspC needs URLClassLoader, with tools.jar
         def parent = Thread.currentThread().contextClassLoader
         def cl = new JspcMojoClassLoader(parent)
-        cl.addURL(findToolsJar().toURI().toURL())
+        if (Double.parseDouble(SystemUtils.JAVA_SPECIFICATION_VERSION) < 1.9) {
+            cl.addURL(findToolsJar().toURI().toURL())
+        }
         Thread.currentThread().setContextClassLoader(cl)
 
         try {
Index: pom.xml
===================================================================
--- pom.xml	(revision 20412)
+++ pom.xml	(working copy)
@@ -296,8 +296,8 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
-                    <source>1.4</source>
-                    <target>1.4</target>
+                    <source>1.6</source>
+                    <target>1.6</target>
                 </configuration>
             </plugin>
 
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to