Upgrading to Java 15 from the MineOS Turnkey ISO

Here are the steps I used to upgrade Java 8 to Java 15 on an installation of the official MineOS ISO. These steps are executed on the MineOS server as root. Ensure there are no running servers or java processes.

apt remove java-common
wget https://download.java.net/java/GA/jdk15.0.2/0d1cfde4252546c6931946de8db48ee2/7/GPL/openjdk-15.0.2_linux-x64_bin.tar.gz
tar -xf openjdk-15.0.2_linux-x64_bin.tar.gz -C /opt/
ln -s /opt/jdk-15.0.2/bin/java /usr/bin/java

(the java url comes from this page https://jdk.java.net/15/. These steps can be used with any OpenJDK version, not just 15. Adjust commands as appropriate for different versions.)

Why are these steps necessary?

This ISO is distributed as Debian “Stretch”, which does not have access to the same repositories as Debian “[anything after Stretch]”. Ultimately, distros will grow older and not have access to new software by default.

Explanation of steps

apt remove java-common
– Remove the default java installation (8). This also removes the file used to launch java which is located at /usr/bin/java.

wget https://download.java.net/.../openjdk-...bin.tar.gz
– Download a Java that is Debian binary-compatible

tar -xf openjdk-15.0.2_linux-x64_bin.tar.gz -C /opt/
– Extract the contents to some directory (in this case, /opt because is it a well-accepted location for Java)

ln -s /opt/jdk-15.0.2/bin/java /usr/bin/java
– Ensure java the binary can be found by root in the $PATH variable. By adding a symlink to /usr/bin which is always part of root's path, this should allow MineOS and users logged in as root (or otherwise) to access java simply.

2 Likes

Fantastic, thank you. Will try this out over the weekend!

Does this allow MineOS to run normally?
I have built a server at home for my kids and myself to play on.
There are currently 7 live worlds, ranging from Galacticraft 1.12.2 with Forge to Vanilla 1.16.4.
My kids are really excited about 1.17.x and as outlined on this forum, Java8 won’t cut it.
If I bring down any of the worlds my kids will surely kill me, they play on the servers daily.
If the answer is have a go and see I’m cool with that. I’ll spin up a VM and test each world, but if it should work okay, then I’d rather apply the fix directly to the main MineOS server.
I’m running MineOS on top of Ubuntu Server 20.04.

installing a new version of Java should not break existing worlds. They will have to be stopped temporarily to install the new version.