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

created at 08-16-2021 views: 3

error message

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

What is the reason for this problem?

Because there are many different versions of JDK installed on the computer, I don't know which version to use when I run the Java program with Notepad, so I get an error.

How to solve this problem?

Uninstall unnecessary redundant JDK and keep the stable JDK version (see personal wishes here, you can keep the latest version of the JDK if you like the latest version, but the more stable JDK version is version 1.8, it is recommended (Retain version 1.8)

How to uninstall redundant JDK version?

① Manual uninstallation: If you do not know the installation path of the redundant JDK, you can do as follows:
Right click on the computer icon---->>click on properties---->>advanced system settings---->>find the environment variables and click enter---->>find the JDK installation path in the system variables; in Find and delete in the folder.

②The java official website has a special uninstall tool, which is more convenient to use
Address: https://www.java.com/en/download/faq/remove_olderversions.xml
Note: After successfully deleting the redundant JDK, you need to check whether the environment variable configuration is correct.
Use Win+R key---->>input cmd---->>and then input: javac -version, java.exe, javac.exe to check whether it is successful.

created at:08-16-2021
edited at: 08-16-2021: