0

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

C:\ProgramData\Oracle\Java\javapath

C:\Users\[USER]\AppData\Local\Packages\Microsoft.4297127D64EC6_8wekyb3d8bbwe\LocalCache\Local\runtime\jre-legacy\windows-x64\jre-legacy\bin

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:

https://java.com/en/download/help/win_controlpanel.html

• 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:

https://www.oracle.com/java/technologies/downloads/#jdk17-windows

• Downloaded from here:

https://download.oracle.com/java/17/latest/jdk-17_windows-x64_bin.exe

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:

https://www.windowscentral.com/minecraft-pc-bundle-announced

The Minecraft Launcher identifies itself like this:

*Launcher for Windows* 
Windows 10.0 2.2.8542
Thursday, December 16, 2021, 7:53:50 PM
02b800b20f858c2d92d48bd57b1ae2bc5773f175
*Bootstrap* 
113
Friday, December 17, 2021, 3:52:10 PM
7fbe7a8a2670ec54ab3a005aaa0ee0bf311fd9f7
*UI* 
8375
Thursday, December 16, 2021, 7:44:31 PM
02b800b20f858c2d92d48bd57b1ae2bc5773f175

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...

https://minecraft.fandom.com/wiki/Tutorials/How_to_get_a_crash_report

...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.

10
  • 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
    Commented 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
    Commented Dec 28, 2021 at 2:51
  • You didn’t implement my suggestion.
    – Ramhound
    Commented 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
    Commented 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
    Commented Dec 28, 2021 at 5:46

1 Answer 1

0

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.

2
  • 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
    Commented 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
    Commented Jan 2, 2022 at 0:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .