If you play the Java version of Minecraft, you might see the following message when you try to start the game or connect to a server:
- Error: a JNI error has occurred, please check your installation and try again.
Here's what to do when you see “JNI error has occurred” in Minecraft.
Information in this article applies to the Java edition of Minecraft for Windows, Mac, and Linux.
What Causes the JNI Error in Minecraft?
JNI errors, or Java Native Interface errors, occur when there's a conflict between your version of Minecraft and your computer's Java libraries. This usually boils down to a couple of possible issues:
- Your version of Java is out-of-date
- The installation file path for Java is corrupted
Since all new versions of Java are backward compatible, updating to the latest version should allow you to run any Java version of Minecraft.
How to Fix a JNI Error in Minecraft
Try these steps in order until Minecraft starts up as normal:
-
Download and install Java updates. Some versions of Windows and macOS have a Java Control Panel that helps you update Java. Otherwise, go to the Java download page, choose your operating system, and get the latest Java Development Kit (JDK) installer. Open the installer file and follow the instructions.
If you're on Windows, download the .exe file.
-
Update Java in the Linux Terminal. If you're on Linux, open the Terminal and enter the following command:
sudo apt-get update
Then, enter the installation command replacing the number “18” with the latest version number for Java:
sudo apt install openjdk-18-jdk
When the update is successful, try starting Minecraft again.
Do a Google search for “latest Java version” to check the current version of Java.
-
Reset the Java installation file path. Even if you have the latest Java updates, the program could be checking the wrong file path. This is a problem that typically only occurs in Windows.
When you get to the Edit System Variables screen, choose any path files that include “Java” and select Delete. Reinstall Java and restart your computer, then try opening Minecraft again.