This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new f73e601  Support Java 11 in Graal Native Images
f73e601 is described below

commit f73e6012f2437f732f711ddf197ccf790d2a38fa
Author: remm <r...@apache.org>
AuthorDate: Thu Nov 28 11:24:38 2019 +0100

    Support Java 11 in Graal Native Images
    
    Add support for Graal 19.3, since Graal now has Java 9+ [without
    modules], the jre9Available needs to be accurate and match the substrate
    VM (otherwise the direct byte buffer cleaner will not be there).
    Java 11 support needs Graal 19.3 and it solves a lot of the big problems
    Tomcat had with Graal with SunEC (now actually always available) and
    ALPN now works.
    The Graal support should now be like the regular JVM: you can use either
    Java 8 or Java 11.
---
 java/org/apache/tomcat/util/compat/GraalCompat.java | 15 ++++++++++++++-
 java/org/apache/tomcat/util/compat/JreCompat.java   |  2 +-
 webapps/docs/changelog.xml                          |  3 +++
 webapps/docs/graal.xml                              |  3 +--
 4 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/GraalCompat.java 
b/java/org/apache/tomcat/util/compat/GraalCompat.java
index 53b67a1..4ae501d 100644
--- a/java/org/apache/tomcat/util/compat/GraalCompat.java
+++ b/java/org/apache/tomcat/util/compat/GraalCompat.java
@@ -17,8 +17,10 @@
 package org.apache.tomcat.util.compat;
 
 import java.io.IOException;
+import java.net.URL;
+import java.util.Deque;
 
-class GraalCompat extends JreCompat {
+class GraalCompat extends Jre9Compat {
 
     private static final boolean GRAAL;
 
@@ -44,4 +46,15 @@ class GraalCompat extends JreCompat {
     public void disableCachingForJarUrlConnections() throws IOException {
     }
 
+    @Override
+    public void addBootModulePath(Deque<URL> classPathUrlsToProcess) {
+        // No support for modules in native images
+    }
+
+    @Override
+    public boolean isExported(Class<?> type) {
+        // No support for modules in native images so return true
+        return true;
+    }
+
 }
diff --git a/java/org/apache/tomcat/util/compat/JreCompat.java 
b/java/org/apache/tomcat/util/compat/JreCompat.java
index b33175b..cea18fb 100644
--- a/java/org/apache/tomcat/util/compat/JreCompat.java
+++ b/java/org/apache/tomcat/util/compat/JreCompat.java
@@ -49,7 +49,7 @@ public class JreCompat {
         if (GraalCompat.isSupported()) {
             instance = new GraalCompat();
             graalAvailable = true;
-            jre9Available = false;
+            jre9Available = Jre9Compat.isSupported();
         } else if (Jre9Compat.isSupported()) {
             instance = new Jre9Compat();
             graalAvailable = false;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2693403..c303810 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -114,6 +114,9 @@
       <update>
         Update the OWB module to Apache OpenWebBeans 2.0.13. (remm)
       </update>
+      <update>
+        Support Java 11 in Graal Native Images with Graal 19.3+. (remm)
+      </update>
     </changelog>
   </subsection>
 </section>
diff --git a/webapps/docs/graal.xml b/webapps/docs/graal.xml
index cb73078..6aea12c 100644
--- a/webapps/docs/graal.xml
+++ b/webapps/docs/graal.xml
@@ -145,8 +145,7 @@ ant -Dwebapp.name=somewebapp -f 
graal-webapp.ant.xml</source>
 
   <p>
     Running the native image is then:
-    <source>./tomcat-maven-1.0 -Djava.library.path=$JAVA_HOME/jre/lib/amd64\
-        -Dcatalina.base=. 
-Djava.util.logging.config.file=conf/logging.properties</source>
+    <source>./tomcat-maven-1.0 -Dcatalina.base=. 
-Djava.util.logging.config.file=conf/logging.properties</source>
   </p>
 
   </section>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to