nicho92 / MtgDesktopCompanion

Cards manager for magic the gathering
Apache License 2.0
155 stars 34 forks source link

Java Exception #220

Closed ghost closed 2 years ago

ghost commented 2 years ago

Describe the bug I get two error messages. The first is

Error: A JNI error has occurred, please check your installation and try again.

And the second is

A Java Exception has occurred.

I've tried reinstalling java but I get the same error.

I tried running it on Manjaro too and it gave me a similar error:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/magic/api/main/MtgDesktopCompanion has been compiled by a more recent version of the Java Runtime (class file version 60.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)

I fixed it by uninstalling openjdk 11 and installing openjdk 17. But libre office depends on openjdk 11 so that has probably created some other problem.

I couldn't fix it on Windows though.

nicho92 commented 2 years ago

Hi @HarleyQuinn-Z6 , your java (jre-8u321-windows-x64) is not supported. You should update it to 16 min.

You can update your java here: https://www.oracle.com/java/technologies/downloads/

You can also use openjdk ... but 16 is the minimal version due to new code syntax and security fix