Java in Google Colab is not updating?

1 day ago 3
ARTICLE AD BOX

I am trying to use r5py within a Google Colab environment, and it won't run.

The issue I get specifically with r5py is that it needs Java 65, but Colab only recognizes up to 61:

java.lang.UnsupportedClassVersionError: java.lang.UnsupportedClassVersionError: com/conveyal/file/FileStorage has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0

I found this question from 6 years ago with a similar issue, but there seems to be a problem with the answer from it:

OpenJDK VM warning: the use of signal() and sigset() for signal chaining was deprecated in version 16.0 and will be removed in a future release. Use sigaction() instead.

I'm not sure how to change it in this cell:

!apt-get install openjdk-8-jdk-headless -qq > /dev/null import os os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-8-openjdk-amd64" !update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java !java -version

Which gives me:

openjdk version "21.0.9" 2025-10-21 OpenJDK Runtime Environment (build 21.0.9+10-Ubuntu-122.04) OpenJDK 64-Bit Server VM (build 21.0.9+10-Ubuntu-122.04, mixed mode, sharing)

Shouldn't that match with the major version numbers to Java version? How can I get the right Java version in the environment?

Read Entire Article