“Error: A JNI error has occurred, please check your installation …” – How to fix it!

You encountered this error message? Don’t panic! You have solved the problem with a simple and fast hand trick. And here you can learn how to do it.
If you have encountered this (or a similar) error message the problem is quickly solved.
“Error: A JNI error has occurred, please check your installation and try again
Exception in thread “main” java.lang.UnsupportedClassVersionError: Main has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 52.0″
The problem occurs because your JRE (Java Runtime Enviroment) and your JDK (Java Development Kit) are not working together correctly.
Often the problem appears if you want to call a .jar file via command line, e.g. via the command java -jar File.jar
or if you have compiled your program with Eclipse before.
If you want to learn more about Java, check out this book*:
Troubleshoot
To fix the bug, you only need to adjust the environment variables for Java.
To do this, you navigate by typing “env” in your Windows search and open the item “Editing System Environment Variables”. In this window click on “Environment Variables…”.

The “Enviroment Variables” window opens. There you select the variable “Path” in the lower window and click on “Edit…”.

There you look for the line where the installation path of your JDK is stored. In this case it is under C:\Program Files\Java\jdk-13.0.1\bin.
If you do not have this entry in your database, you can add it by clicking the “New” button. If you have not yet installed the JDK, you can do so here.

When you have found the line, click on “Move Up” until the entry is at the top of the list. Done!
Now you have to close and reopen the Windows CMD once and the error should be fixed. I hope this post could solve your problem! 🙂
Hi, I got as far as the part where you look for the installation path of your JDK, and I didn’t see the entry so I clicked on new but it didn’t do anything. Then I clicked on the link that you put for if you haven’t installed the JDK, but I’m not sure what I’m supposed to download once I get there. Any help would be amazing, I have no clue what I’m doing but this tutorial was very easy to follow up until the point that I got lost so thank you!
Hi, on this page is a link called “JDK Download” unter de “Oracle JDK” headline. You need to download and install this software. Hope this helps! 🙂
ERRM Please help it won’t work it keeps saying it what do i do?
thankyou bro, its work 100%
super…thank a lot bro…..
It worked, thank you!
Thank you so much, i’t’s been a headache for weeks, I’ve even reinstall but it didn’t work, until I saw your post, it worked , thank you
You’re welcome
Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!
🙂
didnt fix it
Thank you. It worked and saved my time. Grateful.
No problem. 🙂
Nice
Thanks
Many thanks!
Gladly! 🙂
Thank you very much. It worked.
I’m glad, thanks for the feedback! 🙂