Sakai JDK 17 upgrade

129 views
Skip to first unread message

Earle Nietzel

unread,
Dec 10, 2024, 3:16:20 PM12/10/24
to dev sakai
The JDK 17 upgrade is upon us and here are some notes to help everyone upgrade.

  • Upgrade JDK to version 17 (sdkman makes this simple)
    • sdk install java 17.0.13-tem (install Temurin jdk 17)
    • sdk use java 17.0.13-tem (switches jdk in the current shell)
  • Follow traditional build and deploy of sakai src to tomcat
    • mvn(d) clean install sakai:deploy-exploded
    • use mvnd for parallel builds
      • sdk install mvnd
  • Update java options for running tomcat
    • use the following jdk options when starting tomcat (setenv.sh)
      •     JAVA_OPTS="$JAVA_OPTS \
                --add-opens=java.base/jdk.internal.access=ALL-UNNAMED \
                --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED \
                --add-opens=java.base/sun.nio.ch=ALL-UNNAMED \
                --add-opens=java.base/sun.util.calendar=ALL-UNNAMED \
                --add-opens=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \
                --add-opens=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \
                --add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \
                --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED \
                --add-opens=java.base/java.io=ALL-UNNAMED \
                --add-opens=java.base/java.nio=ALL-UNNAMED \
                --add-opens=java.base/java.net=ALL-UNNAMED \
                --add-opens=java.base/java.util=ALL-UNNAMED \
                --add-opens=java.base/java.util.concurrent=ALL-UNNAMED \
                --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED \
                --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED \
                --add-opens=java.base/java.lang=ALL-UNNAMED \
                --add-opens=java.base/java.lang.invoke=ALL-UNNAMED \
                --add-opens=java.base/java.math=ALL-UNNAMED \
                --add-opens=java.sql/java.sql=ALL-UNNAMED \
                --add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
                --add-opens=java.base/java.time=ALL-UNNAMED \
                --add-opens=java.base/java.text=ALL-UNNAMED \
                --add-opens=java.management/sun.management=ALL-UNNAMED \
                --add-opens=java.desktop/java.awt.font=ALL-UNNAMED \
                --add-opens=java.desktop/javax.swing.tree=ALL-UNNAMED"
      • see https://raw.githubusercontent.com/sakaiproject/nightly-config/refs/heads/master/setenv.sh
    • adjust catalina.properties adding "serializer.jar" to list jars that should NOT be scanned
Everything else is the same

At this time we can also begin allowing jdk 17 syntax into the repo, but I would advise that if you know something is to be backported to 23 that you use jdk 11 syntax.

-earle

Adrian Fish

unread,
Dec 11, 2024, 9:31:12 AM12/11/24
to Earle Nietzel, dev sakai
The update is working great for me. Thanks for the comprehensive
instructions - worked a treat.

Just to be clear, how far back does 11 syntax go? Only back to 23? My
memory fails me at this point.
> --
> You received this message because you are subscribed to the Google Groups "Sakai Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.
> To view this discussion visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/CAMddi33%3DjY8zqnEYnM-UTHvuu5griP2-5ah8SaHdb9pA2P3AZw%40mail.gmail.com.

Earle Nietzel

unread,
Dec 11, 2024, 12:24:15 PM12/11/24
to Adrian Fish, dev sakai
Java 8 syntax for 21 and earlier
Java 11 syntax for 22 and 23
Java 17 syntax for 25 and later
-earle

Earle Nietzel

unread,
Dec 11, 2024, 12:26:08 PM12/11/24
to dev sakai
I have found an issue in entitybroker related to reflection, hope to have a patch ASAP.

You will see something similar to:
Direct request failure: InaccessibleObjectException:Unable to make field private static final java.lang.reflect.Method jdk.proxy46.$Proxy871.m0 accessible: module jdk.proxy46 does not "opens jdk.proxy46" to unnamed module @63e6ab6c:Direct request failure: InaccessibleObjectException:Unable to make field private static final java.lang.reflect.Method jdk.proxy46.$Proxy871.m0 accessible: module jdk.proxy46 does not "opens jdk.proxy46" to unnamed module @63e6ab6c: Sakai version: 25-SNAPSHOT(29651afb) Server: localhost(sakai01) [sakai01-1733937007135] Request URI: /direct/site/mercury/info.json Path Info: /site/mercury/info.json Context path: /direct Method: GET

-earle

Earle Nietzel

unread,
Dec 13, 2024, 10:10:00 AM12/13/24
to dev sakai
Just as a follow up I submitted a PR to https://github.com/azeckoski/reflectutils/pull/11 to fix the issues with reflectutils and JDK17.

If you want to deploy with the fix ahead of time clone reflectutils project apply the patch from above and build with mvn clean install which will install reflectutils-0.9.21-SNAPSHOT.jar
then simply and just the version in sakai's master pom to
<reflectutils.version>0.9.21-SNAPSHOT</reflectutils.version>
now you can deploy sakai as normal and the issue in entitybroker (and others) is fixed.

-earle

Earle Nietzel

unread,
Dec 18, 2024, 12:30:38 PM12/18/24
to dev sakai
So the EntityBroker issue is now fixed on master by upgrading reflectutils see

-earle

Reply all
Reply to author
Forward
0 new messages