0

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?

1
  • 1
    The class version is not the Java/JDK version number, but there is a relationship between them. See stackoverflow.com/questions/9170832/…. So class version 61 is from Java 17 and class version 65 is Java 21. openjdk-8-jdk-headless seems to be for Java 8 which doesn't make sense since your command line say Java 21, which is the version required according to the error. I think the question is missing some context. Also the reference to the question about signal() and sigset() doesn't seem related to this issue. Why did you quote it? Commented Feb 3 at 11:50

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.