Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Has anyone figured out how to get freerouting to work on Void Linux yet? #304

Open
Xeraster opened this issue May 15, 2024 · 1 comment
Open

Comments

@Xeraster
Copy link

Xeraster commented May 15, 2024

Somehow freerouting can't be run on Void Linux but it can be run on an old Debian installation.
I get the following error:
/usr/bin/java -jar freerouting-1.8.0.jar Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.UnsupportedClassVersionError: app/freerouting/gui/MainApplication has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:756) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:473) at java.net.URLClassLoader.access$100(URLClassLoader.java:74) at java.net.URLClassLoader$1.run(URLClassLoader.java:369) at java.net.URLClassLoader$1.run(URLClassLoader.java:363) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:362) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)

The latest openjdk that can be installed on Void Linux is openjdk21 which apparently only has java runtime version 52. It might be possible the installer generates a better executable somewhere but I haven't found it yet. I also tried freerouting 1.8.0 and it also requires java version 61.

@parasyte
Copy link

parasyte commented May 19, 2024

It seems likely that you have multiple versions of OpenJDK installed. According to the Java Version Almanac, Class File Version 61.0 is available since Java 17. And according to Differences between Oracle JDK and OpenJDK:

Oracle JDK and OpenJDK builds are essentially identical from Java 11 onward.

Thus, OpenJDK >= 17 will be compatible with the freerouting builds available (at least as far as meeting the Class File Version requirement).

The "Java Runtime only recognizes class file versions up to 52.0" error indicates that you are using Java 8. Possibly openjdk8u?

Since you have openjdk21 installed, you should verify that it is being used. All of the typical troubleshooting suggestions apply: environment, class path, etc. /usr/bin/java --version should print something about OpenJDK 21.


Caveat: I am not familiar with Java, and all of the alternative runtimes and development kits are unnecessarily convoluted and confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants