Home >Database >Mysql Tutorial >How to Resolve the 'A JNI error has occurred' in Eclipse on Windows 8.1?
The error "A JNI error has occurred" in Eclipse is usually associated with a mismatch between the Java Runtime Environment (JRE) and Java Development Kit (JDK) versions used for compilation and execution.
Problem Analysis
In the given code, the program is compiled and run using JRE version Java 8, while the compiler (Java 12) is a separate application that is part of the JDK.
Solution
To fix this issue, you can take the following steps:
Step 1: Uninstall Java 8 JRE
Remove the Java 8 JRE from your computer to eliminate the version conflict.
Step 2: Verify Java Version Consistency
Use the commands:
to check that the same version number is returned for both the JRE and JDK.
Step 3: Recompile and Run
Recompile the program to ensure it's built using the correct Java version. Then, run it to verify if the error persists.
Additional Tips
The above is the detailed content of How to Resolve the 'A JNI error has occurred' in Eclipse on Windows 8.1?. For more information, please follow other related articles on the PHP Chinese website!