I am running a .jar file on my java environment and I encountered following error “java error a jni error has occurred please check your installation and try again”. How can i fix java error a jni error has occurred please check your installation and try again ? is anything wrong with my java installation ?
Share
jahnavi
If you have two java versions both Java jdk 12 and jre 8. so computer gets confused and the problem occurs. The solution was easy. Fix “java error a jni error has occurred please check your installation and try again” by following steps.
Go to command prompt and check Java jdk and jre versions
Type
java – version
(It will return your Java version running)
then Type
javac -version
(It will return Java version with which it is compiling)
A program should be compiled and run using same version (ex=i.e Java 12) if not then try uninstalling a older version or change the path.
OR
To fix this issue you need to edit your environment variable
Search for edit environment variable in control panel then click on it
There you can find path of your jdk
C:\Program Files\Java\jdk-13.0.1\bin.
If not then you need to edit or add a new path
By clicking on “new” button
Click “OK” and save all changes.