This is another common problem where Minecraft users are getting an error message of a JNI error has occurred Minecraft while starting the game (client) or server (.jar).
The problem is mostly coming with the Minecraft versions 1.17 and 1.18 or with the higher versions.
So as soon as you click on the game to start you get a pop-up error message saying “a JNI error has occurred, please check your installation and try again while running the jar file”.
Once you close this another message also pops up saying “A Java Exception has occurred”
What does “a JNI error has occurred” in Minecraft mean?
In this error, JNI stands for Java Native Interface which means the application is trying to load a native library.
So when a Minecraft user opens the game (client) or server(.jar) it fails to find what is required. This can be because of 3 major reasons
What Causes “a JNI error has occurred” in Minecraft?
There are 3 major causes why this error occurs while starting the game or launching Tlauncher.
- Outdated Java – Earlier version of Minecraft was compatible with older versions of Java. But now the latest Minecraft version needs an updated Java version with fully working.
- Java 16 JDK is missing – This is the major reason behind the JNI error. If Java 16 JDK is missing on your PC then you will get this error while launching Minecraft.
- Java is broken – If the system variable path for Java is broken then the Minecraft launcher may fail to launch and gives an error of “a JNI error has occurred”. Because of a corrupted or broken java path, Minecraft fails to detect Java.
Okay, so as you are now aware of the major reasons behind this error, let’s quickly fix this issue so you can enjoy your game.
How to Fix “ A JNI error has occurred” in Minecraft
Now as you are aware of the reason causing this problem, we need to fix these issues accordingly.
Please follow the steps carefully and one by one.
FIX 1 – Install the Latest Java JDK version
Most of the users have the updated version of Minecraft and this is the reason they get this error as Minecraft build 21v19 or newer will bed updated Java JDK version.
If you do not have the updated Java JDK, you will get an error while launching Minecraft Game (client) or Server.
This need to be done in 3 steps so follow the below steps to update and get the latest version of Java JDK.
STEP 1 – Download the Java JDK
- The very first thing that you need to do is to close Minecraft Tlauncher or other is completely closed. You can do this from the task manager or by restarting your PC.
- Now visit Oracle’s official website to download the latest version of Java JDK.
- Once you are on the website, scroll down a bit and click on the Windows tab if you are a Windows user.
- Again scroll down until you find the x64 installer and then click on jdk-8u333-windows-x64.exe which is on the right-hand side under the Downloads.
- Another box will pop up, just check the ☐ box of the license agreement and then click on Download.
- Downloading will now start, wait until the download is complete. As this will be the zip file, so open the download in a folder and then extract all the files.
STEP 2 – Paste the Downloaded Java JDK into Windows Java Folder
- Once you have the extracted folder of Java JDK, you need to paste this into your Java folder which would be in the Windows C drive.
- Open File Explorer and then double-click on C drive to open.
- Look for Program files, double-click on them to open, and then look for the Java folder.
- Double-click on the Java folder to open and then paste the Java JDK extracted folder that you just downloaded.
Once done close it and then restart your PC. Now you are remaining with one more step where you need to upload this downloaded Java JDK in Tlauncher.
But try restarting your PC before moving to the third step.
STEP 3 – Upload the Java JDK in Tlauncher
- Launch Tlauncher again and then click on the settings ⚙️ gear icon at the very right-hand bottom of Tlauncher.
- Once the settings box is up click on Browse which is on the very right of the Java path.
- Now you need to browse the Java JDK file that you uploaded in the second step. Follow the below path
- Here in the bin folder, you will find multiple files and you need to look for javaw.exe, click on it and then click on Open.
- Now click on the Save button and then click on Enter the Game.
I am pretty sure the problem will be fixed but in case you have the trouble, no worries apply the second FIX.
FIX 2 – Delete the Java Broken System Path Varriables
As discussed in the causes for this error above, a broken java system path can also cause such a problem.
According to many Minecraft users, this method worked perfectly.
So what happens because of the broken system path variable of Java, Minecraft launcher gets tricked that there is no Java JDK installed which is not correct.
In this fix, you need to fix this broken path so that the Minecraft launcher can easily detect Java and open the game.
- On your Windows search type sysdm.cpl and hit the enter key to open System Properties.
- Once the system properties box is up, click on the Advanced tab and then on Environment Varriables.
- Now from the environment variable box, go to System variables, click on Path, and then on Edit.
- Here you will see all the variables entries, look for the one with Java, click on it and Delete it.
After deleting the Java variable restart your PC and I am pretty sure that “a JNI error has occurred, please check your installation and try again” issue will now be resolved.
FREQUENTLY ASKED QUESTIONS
Yes, Minecraft uses JNI to work properly. Now all updated version of Minecraft needs the updated Java version to function properly.
If the Minecraft launcher fails to detect the Java or JNI, it will give your error like “a JNI error has occurred”.
Its recommended that you must have the latest version of Java in order to make the Minecraft launcher function properly.
Currently, Java 18 is the latest version. But for Minecraft 1.17 server Java 16 and 18 will both work perfectly.
Every application and program should be updated from time to time for proper functioning. We always recommend that you must update both your Minecraft and Java to enjoy the game without any errors and interruptions.
I am very positive that the above 2 solutions will surely fix “a JNI error has occurred” Minecraft.
In case anyhow the issue still persists then try uninstalling the Java JRE and Java SDK from your Windows programs and features. You can open it by typing appwiz.cpl in the search box.
I guess you go here with a solution but still if you have any issues applying these fixes then let me know in the comment box.
Dear Readers my name is Shahbaz
I am a blogger and a gamer. I have around 8 years of experience working as a Tech Geek.
So I know how technical things work and I am very much active on Discord, Twitch, and in Gaming. I help people on Twitch and Discord by solving their problems related to twitch streaming and twitch tutorials.
Feel free to connect me on my Social accounts or contact me through the contact form.