freerouting icon indicating copy to clipboard operation
freerouting copied to clipboard

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

Open Xeraster opened this issue 1 year ago • 1 comments

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.

Xeraster avatar May 15 '24 15:05 Xeraster

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.

parasyte avatar May 19 '24 00:05 parasyte

Hey there!👋

This issue is stale because it has been inactive for 120 days. If this matter is still relevant, feel free to remove the stale label or add a comment. Otherwise, it will be closed in 7 days.

But remember, with thousands of monthly active users, someone might just have the solution you need. This is a community-driven project, and your active participation is crucial.

If the issue is critical for your work, consider contributing a fix yourself or hiring someone to help. I'm here to support your efforts and will review and merge pull requests as quickly as I can.

Let's collaborate to keep improving our project! 🚀 Your involvement is invaluable, and together, we can ensure the continuous growth and success of our community.

Thank you for being an integral part of this journey. Your engagement is what drives our project forward!

github-actions[bot] avatar Sep 20 '24 12:09 github-actions[bot]