Do these instructions actually work for upgrading ...
# lucee
s
Do these instructions actually work for upgrading to Java21? Because they don't for me (Lucee 6.1): https://docs.lucee.org/guides/installing-lucee/installation-linux/upgrade-JRE.html
For starters, the linked "JRE" page is a new link on Oracle, with JDK downloads. There's no self-extracting 'bin' file, that I can see, etc.
Even just extracting the JDK and replacing the /opt/lucee/jre folder with it leads to a Lucee that won't start up
What has worked is, when I created a new app, using CommandBox to do the install, but I don't think that will work for existing apps, since they aren't run through commandbox.
b
Lucee itself has never required a JDK that I'm aware of
I have no idea about the links in the ugprade guide, but just grab whatever download you need from Adoptium. They have just archives you can unzip and slap in a folder https://adoptium.net/
Generally, you want
/bin/java
to be relative to the root of the JRE
s
I wish that worked. Extracting the version 21 JRE and replacing the /opt/lucee/jre folder with it leads to a broken install that won't start.
At least on my install on CentOS 8.
b
Well, it's hard to help you when you give so little information
"broken" how?
Is there an error?
Do you plan to share it with us?
Could be as simple as the JRE being in the wrong path
s
Sorry, yeah, I get "Service Unavailable" accessing it on the web when trying to start up Lucee. Both for my site and the Lucee admin. The working JRE (Java 11) has /opt/lucee/jre/bin/java And so does Java 21 for its path. What Lucee log would have the startup errors in it? I've tried application.log, but that doesn't appear to have it.
b
If it's a Java level error, there's prolly nothing in the logs because the JVM never starts
You need to start Catalina directly from bash and you'll see the error there
Maybe also be in your linux service logs
If you run the same start command your system.d runs to start the service, you should be able to see it
s
Hmm, catalina.out has this:
Copy code
NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.bas$
Unrecognized VM option 'PermSize=512m'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Maybe it's just the PermSize arg
b
yrp
permsize hadn't been around for a long time
remove it
prolly in catalina.sh or setenv.sh maybe
you can search for
-PermSize=512m
s
Aha, paydirt. You can replace it since Java 17 with
MetaspaceSize
it seems.
Sorry for the false alarm. I thought for sure it should just be as easy as unzipping a directory
...And it was!
b
They should still update the guide to tell people to check for that
I wouldn't set a size
Modern JVMs are pretty good at auto-managing their GC without a bunch of JVM args like the old days
Just let the G1GC do its job and see if it needs tweaking
metaspace is now on heap and managed differently
s
Thanks for the suggestions, much appreciated :)