I figured out you can remove references to endorsed in
catalina.sh to get Java 10/11 to work with Lucee. I put the directions at the bottom of this comment.
However, I have found that using a newer version of Java causes permanent and massive slowdown in compilation times for changes to CFC code compared to running Lucee Java 8. 100% certain that the issue is the Java version and not something else. I hope that can be fixed somehow whenever Java 11+ and tomcat are upgraded in the Lucee installer.
I also had figured out how to run Java 10 and Tomcat 9 with lucee prior to Java 11’s release, and the same compilation slowness exists there unfortunately, so Tomcat 9 is not the answer.
There is nothing broken about Lucee running on Java 10/11 code though if you can tolerate waiting up to 5 seconds longer every time you change a CFML file. I have been getting annoyed by this though, and I’m going to downgrade back to Tomcat 8 / Java 8 so that I can work fast again.
If anyone has an answer for this compilation slowness, please share.
Notes for using Java 11 with Lucee:
I manually installed openjdk 11.0.1 to the lucee jre directory on Ubuntu 18.04:
I say manual, because openjdk via apt-get on ubuntu 18.04 still installs openjdk 10 despite it being named 11 as of today. So I went to openjdk web site and directly downloaded and uncompressed the 64 bit linux build they offer there. Uncompressing to the right place is the only installation step required.
Then I found the endorsed error prevents the tomcat JVM from starting like someone else said on this thread.
I deleted all the references to
in this file:
I was able to start lucee on openjdk 11.
Java 11 then had to recompile all of the cfc files of my application, which appeared to take forever, to the extent that I had to restart lucee 3 times to get it to finish compiling due to timeouts or whatever. My complex Lucee application was able to load on Java 11 without any other modifications though. Runtime performance is not degraded once compiled again, but that compilation time is quite bad. Perhaps the Bytecode transform stuff needs an upgrade or the removal of Unsafe stuff in Java 9 hurt Lucee. I have a feeling that deleting the cfclasses directory of Lucee’s context might help to fix the initial re-compiling problem too. I deleted cfclasses to resolve a problem with some of my code not being able to recompile the CFML again.
Tomcat 8 documents the endorsed directory feature as a way for them to override some kind of XML parser library on startup, but it doesn’t appear important to Lucee. They say it doesn’t work in Java 9+ and offer no solution. I just guessed it could be removed and found it can.