Switch default Java to Java 11

I’m coming from Ubuntu 18 and was wondering if switching the default JVM to Java 11 was an option. I see that everything in /usr/bin is symlinks…could I just change them all myself without breaking something? Is there a preferred way? Any other recommended solutions if changing the system’s default Java isn’t recommended? Basically, I’m looking for something like update-alternatives --config java

Files under /usr are maintained by swupd and it will repair/fix them if it finds they have been tampered with. However, you can use /usr/local to make your own symlinks and thus override PATH order to make your programs use a specific program before another.

Footnote: /usr/local and a few other special places under /usr are not modified by swupd, ever.

Currently our Java champion is planning to solve this issue. Stay tuned.

1 Like

Great. I got past this issue locally by setting my local JAVA_HOME and doing most everything through maven. Also installing intelliJ directly in my user directory instead of through the flatpak helped tremendously.

Is any update on this? Maybe there is some issue ticket where we can see the status?
The JDK8 is no longer officially supported and all other distros use JDK11 (LTS) by default.
I found a ticket where it was requested JDK11 bundle but it seems not active

I installed the Java13 bundle but the system still uses the java basic bundle to run programs. Is there a solution to this

1 Like

Clear Linux uses a Lightweight wrapper for running java.

Just set your $JAVA_HOME to /usr/lib/jvm/java-1.11.0-openjdk,
or
remove the JDK that you do not need.

The wrapper source code is here