I updated from Minecraft 1.16.2 to the latest version of Minecraft at this time which is 1.18.1, opened the Minecraft Launcher client, selected "Latest release 1.18.1" from the drop down, hit the "PLAY" button, and received an error message "jni error has occurred" (and also a generic java error and a crash following that).

Running on Windows 10 Home, 64-bit, Version 21H2, Build 19043.1415, with Intel i7.

Tried a lot of things so far. This is the current state of my setup:

I now have only these folder containing java executables as far as I know:

C:\Program Files\Java\jdk-17.0.1\bin

C:\Program Files\Java\jre1.8.0_311\bin

C:\Program Files (x86)\Common Files\Oracle\Java\javapath



As far as env variables that mention java, jdk, or jre, I have only these:

System Properties: Advanced: Environment Variables:

JAVA_HOME=C:\Program Files\Java\jdk-17.0.1

Path=C:\Program Files\Java\jdk-17.0.1\bin

Minecraft Launcher has this setting:

Installations tab: Latest release: More options: Java executable:

C:\Program Files\Java\jre1.8.0_311\bin\javaw.exe

From command prompt...

C:\Users\[user]>javac -version
javac 17.0.1

C:\Users\[user]>java -version
java version "17.0.1" 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)

Some highlights of other things I tried so far:

• Tried using ecosia and superuser search to find the error message, but those solutions were basically just "update java".

• Updated java by using the Java Control Panel, like described here which got me a new JRE:


• Uninstalled everything minecraft in Add/Remove programs dialog, reinstalled everything (and of course restarted the launcher and computer numerous times in between various attempts).

• Thought maybe "update java" is ambiguous, so I went to get a new JDK too:


• Downloaded from here:


Not sure why the naming convention changed: Used to be jdk-1.8.0_152 but is now jdk-17.0.1. No big deal, I assume.

• Before this update the Minecraft Launcher had a visible EXE and various files and folders alongside (as well as a related workaround for a jni-related bug that mentioned bundling which I believe affected the launcher itself), but the current version lacks a visible EXE and folders, and therefore I see no way to try such workarounds anymore.

I believe this is the "bundled" version referred to here:


The Minecraft Launcher identifies itself like this:

*Launcher for Windows* 
Windows 10.0 2.2.8542
Thursday, December 16, 2021, 7:53:50 PM
Friday, December 17, 2021, 3:52:10 PM
Thursday, December 16, 2021, 7:44:31 PM

The "Report a Launcher bug" link goes to https://bugs.mojang.com which I can't access due to this issue:

Google Authenticator infinite loop on bugs.mojang.com

None of that seemed to have any effect. Error persists.

I tried to get a crash report like so...


...but there were no crash reports of either kind (.txt or .log) that are from any recent day.

Interesting comparisons:

If I tell the Launcher to use java.exe instead of javaw.exe I don't get the jni error message, but Minecraft immediately crashes nonetheless.

If I select Minecraft 1.16.2 in the Minecraft Launcher's dropdown list, that still launches fine.

  • The only path to Java should be C:\Program Files\Java\jdk-17.0.1 edit your environmental variables to reflect that. Be sure you uninstall outdated and any unsupported versions of Java.
    – Ramhound
    Dec 27, 2021 at 5:25
  • @Ramhound, based on that, I removed the jre1.8.0_311 folderpath from the Path environment variables but did not uninstall it, and I did uninstalled jdk1.8.0_152 which appeared in Add/Remove Programs as "Java SE Development Kit Update 152 (64-bit)". So I now have only two folders: C:\Program Files\Java\jdk-17.0.1 and C:\Program Files\Java\jre1.8.0_311 and for environment variables that mention java, jdk, or jre, I have only these: JAVA_HOME=C:\Program Files\Java\jdk-17.0.1 and Path=C:\Program Files\Java\jdk-17.0.1\bin...C:\ProgramData\Oracle\Java\javapath. But error persists.
    – Nathan
    Dec 28, 2021 at 2:51
  • You didn’t implement my suggestion.
    – Ramhound
    Dec 28, 2021 at 4:27
  • Let's see... only path... yes... edit env.... yes... uninstall outdated... yes. Well, you said 3-ish things and I did 3 somethings that seem to correspond, but I guess 1 or more of them wasn't what you meant, is that it? Hmm, what else could I be misinterpreting...? Could be you meant "path" or "reflect" or "outdated" in a specific way that I don't expect. Yikes, it could be ANY word you said that I took a different way really. Or phrase. I could interpret "the only path to Java should be..." as "uninstall the JRE" because that's a path, lol. Could you give me a hint which part's wrong please?
    – Nathan
    Dec 28, 2021 at 5:05
  • Also tried removing \bin from C:\Program Files\Java\jdk-17.0.1\bin in Path, in case you meant "path to Java" strictly (though previously bin was needed). Also tried removing JAVA_HOME since that's an env var and value is a different "path to Java", so to speak, since "Java" is one of the foldernames in that path. As expected, neither of those worked, but I thought maybe the mental exercises might spark some insight into your charmingly ambivalent response. I figure it's something straightforward I'm interpreting wrong, because if it were complex or subtle, you'd have said what it is.
    – Nathan
    Dec 28, 2021 at 5:46

1 Answer 1


Minecraft's "jni error has occurred" message and crash can be solved in a case like this, by simply removing the entry in Minecraft Launcher: Installations tab: Latest release: More options: Java executable:

C:\Program Files\Java\jre[version]\bin\javaw.exe

It will then display this grey message instead:

<Use bundled java runtime>

(Having the path to the JRE in there was required for at least some users when running previous versions of the launcher, so in a way, it's a gotcha that just updating it to the obvious value causes a problem.)

Afterwards the Minecraft Launcher launched Minecraft 1.18.1 just fine for me.

  • By the way, for posterity... 1. The same error message in other cases seems to have a solution involving OpenGL Java and the OptiFine mod. 2. The vanilla Minecraft Server 1.18.1 (minecraft.net/en-us/download/server) still has the same error message and crashes even when the <Use bundled java runtime> solution works fine for Minecraft Launcher launching Minecraft.
    – Nathan
    Dec 28, 2021 at 22:46
  • This is the solution (or workaround) to the same error message seen when running Minecraft Server 1.18.1... In previous versions, some or all users were able to double-click server.jar file to start the server and open its interface. That simple method no longer works for some or all users. The other common method still works and avoids the error: Create a text file, put two lines in it, something like this... java -Xmx1024M -Xms1024M -jar server.jar and pause. Save it as start.bat. Show file extensions to confirm. Double-click the batch file to run the server and open the interface.
    – Nathan
    Jan 2 at 0:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.