leolewis / openvisualtraceroute

Open source cross-platform (Windows/Linux/Mac) Java Visual Traceroute, packet sniffer and Whois.
http://visualtraceroute.net/
GNU Lesser General Public License v3.0
153 stars 30 forks source link

Error on Windows 11 #17

Closed gjf closed 2 years ago

gjf commented 2 years ago

Latest version 2.0.0 gives n error when started on Windows 11 x64 with Java 8 u331 onboard (the latest JRE version as for now):

$ java -Xmx512m -Djava.awt.headless=false -jar ./org.leo.traceroute.jar --illegal-access=warn --add-exports java.base/java.lang=ALL-UNNAMED --add-exports java.desktop/sun.awt=ALL-UNNAMED --add-exports java.desktop/sun.java2d=ALL-UNNAMED
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/leo/traceroute/Main has been compiled by a more recent version of the Java Runtime (class file version 55.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(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

Version 1.7.1 works OK.

leolewis commented 2 years ago

Version 2.0.0 requires Java 11 or higher, please refer to the installation documentation at https://visualtraceroute.net/installation.html

gjf commented 2 years ago

Version 2.0.0 requires Java 11 or higher, please refer to the installation documentation at https://visualtraceroute.net/installation.html

There is no released JRE 11 for Windows yet. Do you mean I have to install a whole JDK just to make to work this piece of code?

leolewis commented 2 years ago

Correct, the concept of JRE was removed with Java 11 https://stackoverflow.com/questions/53111921/how-can-i-get-java-11-run-time-environment-working-since-there-is-no-more-jre-11 I will do a bit of research (especially around licensing) see if I can embed a custom open JDK in the install for a future version.

gjf commented 2 years ago

Yes do it please. BTW even with installed JDK 18 v.2.0.0. crashes at start: Screenshot 2022-06-03 234109 Sure 1.7.1 cannot be started at all with this JDK version. output.log

garry-ut99 commented 8 months ago

I have the same crash, have you been able to solve the issue?

leolewis commented 7 months ago

Please try the latest build 2.1.0 for windows, which has the right JRE embedded and should workaround this issue

garry-ut99 commented 7 months ago

Works.