How do you solve a JNI error has occurred Please check your installation and try again?

As many fans are aware, Minecraft Caves & Cliffs update was recently released. This highly anticipated update contained a myriad of new features, including new mobs, blocks, items, and achievements.

Unlike previous versions, Minecraft server software now relies on the latest version of Java (Java 16) in order to function correctly. The most common cause of the JNI error while trying to set up a Minecraft server is due to the Java version installed on the machine being outdated.

Fortunately, it's easy enough to fix this issue via simply updating Java. This will only take a few minutes at the most, and all the relevant steps will be carefully explained below.


Why are players getting a JNI Error while trying to set up a Minecraft server?

Previous versions of Minecraft carried server software that was compatible with older versions of Java. However, this was not the case with the latest Minecraft update, which now requires Java in order to launch and run correctly. Players can download the latest version of Java and install it to avoid any JNI errors in the game.

This is why players who have successfully run Minecraft servers in the past with older versions may now be seeing this error upon trying to set up a 1.17 server.

How do you solve a JNI error has occurred Please check your installation and try again?
Minecraft players who are using an outdated version of Java will be greeted with this message

How can players fix the JNI Error?

In most cases, the JNI error can be fixed simply by updating Java on the device to match the latest release. In this case, it's Java 16.

Players can follow the steps below in order to complete the installation of Java 16 for Minecraft:

Step 1.)

The first step is to download the Java 16 installer. Players can easily do this by visiting the official Oracle website. Oracle are the creators of Java, and direct downloads for Java 16 can be found here.

Players can select their correct download based on whether they are on a Windows or Mac machine. The majority of Windows users will want to download the file ending with .exe, as shown in the image below.

How do you solve a JNI error has occurred Please check your installation and try again?
Windows users will want to download this version of the Java 16 installer

Step 2.)

After successfully downloading the Java 16 installer, players now need to install the software on their machine. This process can be initiated by simply double-clicking the executable file that has been downloaded and allowing the installer to make changes if asked.

Step 3.)

After the installer has been launched, it's smooth sailing from there. All players need to do is hit the "next" button a few times, and the installer should do the rest.

Once complete and fully installed, players should be greeted with the message below. The JNI error should now be fixed, and players can try launching the 1.17 Minecraft server software.

How do you solve a JNI error has occurred Please check your installation and try again?
This screen should be displayed upon successful installation of Java 16

How do you solve a JNI error has occurred Please check your installation and try again?


Also read: How to copy and paste using WorldEdit in Minecraft


Rate this story!

Thank You!

Edited by Rachel Syiemlieh

Coming soon!

Solution:

① Check whether the package name contains “Java” and modify it. Java should be avoided when creating the package.

② Run the Java version and javac version commands in CMD to check their own JDK and JRE versions. If they are different, reconfigure the environment variables to make them consistent

The above two steps can solve most of the problems. If they are still not solved, it is recommended to reinstall the JDK and reconfigure the environment variables.

Read More:

Error message

How do you solve a JNI error has occurred Please check your installation and try again?

Solving process

According to the error information, the reason for the error is that the version of the compiled Java code is different from the current version of java used for running. And the compiled version only supports running versions of 52.0 or above. Thus, it can be seen that the Java version currently used for running is lower than 52.0. First of all, you need to understand what is the compiled version and what is the running version. That is, we need to distinguish JRE from JDK.

When we install the Java environment, one version will correspond to two folders, JRE and JDK. JRE represents the Java runtime environment, that is, the Java runtime environment, while JDK represents the Java se development kit (JDK), that is, the Java compilation environment. We can check whether the versions of the two environments are consistent in CMD (as shown in the following figure):

How do you solve a JNI error has occurred Please check your installation and try again?
java – version views the version of JRE (running environment). Javac – version looks at the version of JDK (compilation environment). Note: if you cannot successfully view the version by entering the above command, it indicates that there is a problem with the environment configuration. Please refer to here. Back to the point, if you find inconsistencies after checking the version, reconfigure the environment to ensure that the version is consistent and then recompile and run. It should be noted that I didn’t write the code here, and only got the compiled class file, so I can only solve this problem by changing the running java version. From the error message, we can know that after compilation, this code only supports the JRE environment of java version 52.0 or above. Even if we don’t know which java version 52.0 corresponds to, it must be higher than 1.8.0. In order to avoid problems in the future, I plan to directly update the entire java version, that is, replace JDK and JRE with a new version. Also, considering that 1.8.0 may be needed in the future, I will not delete the 1.8.0 version.

Solution

First download the Java version of 1.9, that is, download the installation package of jdk9.0 (JDK package includes JDK and JRE, 9.0 is 1.9). Here is the network disk link of (windows-x64)
extraction code: 63q0 after downloading and installing, you can start configuring the environment. In order to facilitate management, I put 1.9 under the same path as the previous 1.8. As shown in the following figure:

How do you solve a JNI error has occurred Please check your installation and try again?
modify the original Java in the system variable_ Home and JRE_ Home path to point to the newly installed java version of 1.9 (if the way to configure the environment is different from mine, it doesn’t matter. In essence, it’s just that the path to point has changed. I suggest this way to configure it for management convenience. Please refer to the configuration link provided above). As shown below

How do you solve a JNI error has occurred Please check your installation and try again?

How do you solve a JNI error has occurred Please check your installation and try again?

Check the versions of JDK and JRE again (remember to re open CMD after confirmation)

How do you solve a JNI error has occurred Please check your installation and try again?
run the code again and run successfully
How do you solve a JNI error has occurred Please check your installation and try again?

Read More:

How do you fix a JNI error has occurred Please check your installation?

This a JNI error has occurred Minecraft server error occurs when you try to start Minecraft or a Minecraft server on a PC that does not have the latest version installed. To fix this, you just need to update your current Java to the latest version.

How do I fix JNI errors?

Fix JNI Error in Minecraft (2022).
Update And Install Latest Java Version (Windows, Mac, and Linux).
Reset Java Path to Fix Minecraft JNI Error (Windows Only).
Install Java on Linux to Fix Minecraft Errors..
Uninstall Old Versions of Java on Your PC (Optional).

How do you solve a Java exception has occurred?

Usually this happens because by default in the OS if java -version is searched it might show some old JDK version, so either change global env variable's value if you have privileges to do so else e.g., in linux instead of typing only 'java' while executing, type the complete path e.g., /usr/jav/jdk1.