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

JNI Error #33

Closed
LunarstarPony opened this issue Aug 26, 2021 · 7 comments
Closed

JNI Error #33

LunarstarPony opened this issue Aug 26, 2021 · 7 comments

Comments

@LunarstarPony
Copy link

System: Windows 10
When I try to start the Exe file and windows pop up said Error: A JNI error has occurred, please check your installation and try again, this happened on both Jar and exe.
2021-08-26_14-46-57

@Araxeus
Copy link
Owner

Araxeus commented Aug 26, 2021

Check this StackOverflow answer (In short - you probably have a problem with java version)

@LunarstarPony
Copy link
Author

Sooo What Java Version should I use with this?

@Araxeus
Copy link
Owner

Araxeus commented Aug 26, 2021

Java >= 8
(im using jdk 15 and it works)

If it still doesn't work, try running the jar from cmd to see the exact error message like so:
C:\folder\where\jar\stored>java -jar JarName.jar

@LunarstarPony
Copy link
Author

LunarstarPony commented Aug 26, 2021

It doesn't work with Java 8, It works when I install JDK 15 tho Thx for your help!

@EarthenSky
Copy link

Hey, I also had this error & this thread really helped! I think it would be helpful to pin or allude to this error somewhere on the readme.

@Araxeus
Copy link
Owner

Araxeus commented Dec 20, 2021

Hey, I also had this error & this thread really helped! I think it would be helpful to pin or allude to this error somewhere on the readme.

done :)

@radegeddon
Copy link

Run CMD> java -jar png-upscale-1.0_Windows64bit.jar

If you get this error:
"Exception in thread "main" java.lang.UnsupportedClassVersionError: core/MainApp has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to ..."

You need to install Java SE v15 or higher, as indicated in this table that shows the mapping between Java SE Version and Major Version:
Java SE Major version
1.0.2 45
1.1 45
1.2 46
1.3 47
1.4 48
5.0 49
6 50
7 51
8 52
9 53
10 54
11 55
12 56
13 57
14 58
15 59
16 60
17 61
18 62
19 63
20 64
21 65

The table is taken from:
https://docs.oracle.com/javase/specs/jvms/se21/html/jvms-4.html
https://javaalmanac.io/bytecode/versions/

java.exe executable is in C:\Program Files\Java\jdk-21\bin directory, so that is what you need to have in PATH.

Use Rapid Environment Editor tool (https://www.rapidee.com) to quickly verify or edit the environment variables on Windows.
It allows to reorder PATH entries. It will also highlight invalid paths in red.

The solution is to have Java 15 (or higher) bin directory in PATH or above instead of Java 8. On Windows you may have C:\Program Files (x86)\Common Files\Oracle\Java\javapath added to PATH automatically which points to Java 8.

If that is the case, remove the Java 8 part from PATH and then logout/login or reboot for the changes to have effect.

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

4 participants