Failed to load the JNI shared library [Fix] (2024)

When you try to open or start Eclipse or other software like Spring Tool Suite (STS), KNIME, Dbeaver, etc on your Windows 11 or Windows 10 computer, you may get the error stating Failed to load the JNI shared library. This post provides applicable fixes to the error that can help affected PC users resolve the issue on their system.

Failed to load the JNI shared library [Fix] (1)

What is a shared library in Java?

In Java, a shared library is files used by multiple applications. Each shared library consists of a symbolic name, a Java classpath, and a native path for loading Java Native Interface (JNI) libraries. Typically, shared libraries can be used to reduce the number of duplicate library files on your system.

Typically, the error message snippet reads as follows:

Failed to load the JNI shared library “C:/JDK/bin/client/jvm.dll”`

PC users that encountered this error reported the problem often appears as soon as you run the software after been installed on the system — the software usually just closes afterward. The error indicates that the Java Native Interface (JNI) library required by the software cannot be found or loaded. This error is known to be triggered often by any of the following common reasons.

  • Mismatching architecture (bitness) versions of the problematic software and Java Runtime.
  • Java is not installed on the system, or the installation is corrupted.
  • Both the 32-bit and 64-bit versions of Java or multiple versions of the problematic software are installed.
  • The software doesn’t detect or point to the wrong Java installation folder.
  • The JNI library is missing or corrupt.
  • System configuration issues.

Fix Failed to load the JNI shared library

If you get Failed to load the JNI shared library when you try to open software like Dbeaver, KNIME, Eclipse, Spring Tool Suite et al on your Windows 11/10 computer, then the solutions we have drawn up and presented below can help you easily fix the error.

  1. Start the software with the -cleanoption
  2. Edit the software .ini file
  3. Make sure the software and Java versions match
  4. Remove the Java Path Variable
  5. Reinstall the software.

Let’s see how these fixes apply. Before you proceed, depending on the software throwing the error on your system, make sure you’re running the latest version/build of the software then see if the issue is resolved. Likewise, try updating your system libraries (this includes .Net Framework and Visual C++ redistributable) and update drivers.

1] Start the software with the -cleanoption

When you launch the software normally and it throws the Failed to load the JNI shared library error on your Windows 11/10 computer, youcan try starting the software with the -clean option, which will reset the software configuration. To do this, open a command prompt and navigate to the software installation directory,

2] Edit the software .ini file

This fix requires you to edit the problematic software .ini file to make sure the software is pointing to the correct Java installation and the software is configured to use the correct Java version and the Java executable is in the system path. To perform this task, follow these steps:

  • Open File Explorer.
  • On the C:\ drive, navigate to the installation directory of the Java Development Kit.
  • At the location, navigate to jrex.x.xx > bin and select the javaw.exe file. The x.x.xx placeholder represents the version of Java you have installed.
  • Now, press the Alt+D key combo to change the breadcrumb navigation and highlight the address bar.
  • Press CTRL+C to copy the full file path to the Clipboard. Alternatively, in Windows 11, right-click the exe file and select Copy as path from the context menu.
  • Next, navigate to the problematic software installation folder. You can right-click the software shortcut and choose the Open file locationoption from the context menu.
  • At the location, right-click the software ini file (for example, eclipse.ini) and choose to open it with Notepad.
  • Now, make sure you navigate to the top of the file and paste the lines below. Substitute the path\to placeholder with the file path you copied from the File Explorer address bar.
-vmC:\path\to\64bit\java\bin\javaw.exe
  • Save the file and exit.

Now, relaunch the program and see if the error reappears. If so, continue with the next fix.

3] Make sure the software and Java versions match

For this fix, if you are using a 64-bit version of the problematic software, you should also make sure you install the 64-bit version of Java Runtime. Likewise, you need to do the same if using the 32-bit version. So, if that’s the case, then you can uninstall Java and then download/install the correct Java bitness version to match the software bitness on your system.

4] Remove the Java Path Variable

In the case where you have both the 32-bit and the 64-bit versions of Java installed on your computer, the software throwing the error may be unable to determine the appropriate Java version to use. For example, if a 64-bit version of the software tries to use the 32-bit version of Java, the error is triggered. In this case, to resolve the issue, instead of uninstalling one version of Java, you can simply delete its Path variable by following these steps:

  • Press the Windows key + R to invoke the Run dialog.
  • In the Run dialog box, type sysdm.cpl and hit Enter to open System Properties.
  • Click the Advanced tab.
  • At the bottom right section of the Advanced tab, click the Environment Variables button.
  • Under the User variables section, you will see a list of all user variables.
  • Click the Pathvariable underSystem variablesor theUser variables section
  • Click the Edit button below.
  • Locate a path for the Java folder (that doesn’t match the version of the problematic software installed), select it, and choose Delete from the left-side menu.

Try reopening the program and checking to see if it will run properly now. If not, proceed with the next fix.

5] Reinstall the software

You can uninstall the software, and then download the latest version of the software and install it on your Windows 11/10 computer. This action will most likely resolve the issue.

I hope this post helps you!

Read next: A JNI error has occurred in Minecraft

What is the purpose of JNI?

With the JNI library, programmers can write native methods to handle situations when an application cannot be written entirely in the Java programming language. For example, this can be used when the standard Java class library does not support the platform-specific features or program library.

Failed to load the JNI shared library [Fix] (2024)

FAQs

Failed to load the JNI shared library [Fix]? ›

In this tutorial we will solve - Failed to load the JNI shared Library. The architecture of Eclipse is not matching with the architecture of the JVM. Either of them must be in 32 or 64 bit. Or each and every one must be in 32 bit version.

What is failed to load JNI shared library? ›

In this tutorial we will solve - Failed to load the JNI shared Library. The architecture of Eclipse is not matching with the architecture of the JVM. Either of them must be in 32 or 64 bit. Or each and every one must be in 32 bit version.

How to fix Java error A JNI error has occurred Please check your installation and try again? ›

How to Fix a JNI Error in Minecraft
  1. Download and install Java updates. Some versions of Windows and macOS have a Java Control Panel that helps you update Java. ...
  2. Update Java in the Linux Terminal. ...
  3. Reset the Java installation file path.
Sep 27, 2023

What is a JNI library? ›

The JNI is a native programming interface. It allows Java code that runs inside a Java Virtual Machine (VM) to interoperate with applications and libraries written in other programming languages, such as C, C++, and assembly.

Why does a JNI error occur? ›

Such errors fall into the class of JNI or Java Native Interface errors. These errors usually occur when the Java files are too new or the Java version of your device is outdated. Sometimes these errors also occur when the installation path of the Java files is broken.

What is JNI in Eclipse? ›

The library/system calls needed to access a file on Windows is different from the library/system calls needed to access a file on a Mac. The JVM uses the Java Native Interface (JNI) to prove access to they system level services.

How do I enable Java in Eclipse? ›

Open Eclipse. Click Workbench. Click Window > Open Perspective > Java to open the Java perspective.

How do you fix a Java error? ›

  1. Use try-catch blocks.
  2. Specify exception types.
  3. Use finally blocks.
  4. Use throw statements.
  5. Handle exceptions at appropriate levels.
  6. Identifying the root cause of errors.
  7. Use of profiling and other debugging tools to identify and fix errors.
Mar 5, 2023

What is JNI error in Java 11? ›

Details. The error here is coming because the version of Java required by the application is not installed. Referring to the doc below, java 11 and above is required. Prior to using the command line, it is preferable to install the Highlight Local Agent on your machine, in order to embed the required Perl binaries.

How do I add JNI? ›

Adding our C code
  1. JNIEXPORT – marks the function into the shared lib as exportable so it will be included in the function table, and thus JNI can find it.
  2. JNICALL – combined with JNIEXPORT, it ensures that our methods are available for the JNI framework.
  3. JNIEnv - the most important component of the JNI space.
Mar 22, 2020

What is a shared library in JVM? ›

Shared libraries are files used by multiple applications. Each shared library consists of a symbolic name, a Java™ class path, and a native path for loading Java Native Interface (JNI) libraries. You can use shared libraries to reduce the number of duplicate library files on your system.

Why is shared library locked on Steam? ›

This is error indicates that someone else is using the shared library. A Steam library can only be used by one user at a time to play one game at a time.

What does an error occurred while updating game shared library locked? ›

Usually, the error indicates that someone else is accessing the Steam library simultaneously. This is because the Steam library can only be accessed by a single person at one time.

References

Top Articles
Latest Posts
Article information

Author: Dr. Pierre Goyette

Last Updated:

Views: 5955

Rating: 5 / 5 (50 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Dr. Pierre Goyette

Birthday: 1998-01-29

Address: Apt. 611 3357 Yong Plain, West Audra, IL 70053

Phone: +5819954278378

Job: Construction Director

Hobby: Embroidery, Creative writing, Shopping, Driving, Stand-up comedy, Coffee roasting, Scrapbooking

Introduction: My name is Dr. Pierre Goyette, I am a enchanting, powerful, jolly, rich, graceful, colorful, zany person who loves writing and wants to share my knowledge and understanding with you.