Failed to Load the JNI shared Library (JDK)

Tag: , ,

When I try opening Eclipse, a pop-up window states Failed to load the JNI shared library "C:/JDK/bin/client/jvm.dll". Following this, Eclipse force closes.

Here’s a few points I’d like to make:

  • I checked to see if anything exists at that path. It does exist.
  • My Eclipse and JDK package are both 64-bit. I checked my system, and it can handle 64-bit.
  • I’ve already Googled the problem and can’t find an answer to this.
  • I’ve searched for this problem on StackOverflow and the only answer I found was to download the 32-bit versions of JDK and Eclipse.

Downloading the 32-bit versions is something I only want to do as a very last resort. Any alternatives/suggestions?

Incoming search terms:

13 Answers

  1. arora on May 18, 2012

    You need a 64 trio:

    • 64-bit OS
    • 64-bit Java
    • 64-bit Eclipse

    Regards

  2. fernando-correia on May 18, 2012

    In addition to the already accepted post:

    Working pairings OS/JDK/eclipse:

    • 32bit OS, 32bit JDK, 32bit eclipse (32 bit only)
    • 64bit OS, 32bit JDK, 32bit eclipse
    • 64bit OS, 64bit JDK, 64bit eclipse (64 bit only)

    Had the same problem:

    Had several JDK’s and JRE’s, along with several entries within the PATH variable, all was working more or less. (Miraculously?)

    Cleaned up my mess, deinstalled all Java’s, installed only JDK + JRE 1.7 64bit. One of the eclipse ‘installations’ failed afterwards with the Failed to Load the JNI shared Library and a given path relative to the fresh installed JDK where it thought the jvm.dll to be.

    It was the only one that was 32 bit.

    Adding VM arguments in the eclipse.ini was no use (ofc), I could not find out a way to check if this eclipse was a 32 or 64 bit version. (Could not look it up in the Task Manager, since this one would not start, and it had been a while since it was set up.)

    In case you use a newer JDK and a older JRE you might be in for trouble, too, but then it is more likely a java.lang.UnsupportedClassVersionError appears IIRC.

  3. scott on May 18, 2012

    I had same problem

    I resolved it by installing 64 bit JVM from

    http://www.java.com/en/download/manual.jsp

  4. harry on May 18, 2012

    -startup
    plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
    --launcher.library
    plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.2.R36x_v20101222
    -product
    org.eclipse.epp.package.java.product
    --launcher.defaultAction
    openFile
    --launcher.XXMaxPermSize
    256M
    -showsplash
    org.eclipse.platform
    -vm
    C:Program FilesJavajdk1.6.0_32binjavaws.exe
    --launcher.XXMaxPermSize
    256m
    --launcher.defaultAction
    openFile
    -vmargs
    -Dosgi.requiredJavaVersion=1.5
    -Xms40m
    -Xmx512m
    

    use OS and Eclipse both 64 bit or both 32 bit keep same and confi “eclipse.ini” like this

  5. fernando-correia on May 18, 2012

    I had a similar problem. It was solved doing the following :

    • Move eclipse to program files (not to program files (x86))
    • remove the path to the 32 bit version of java from the ‘path’ environment variable

    I have both version of java installed, but Eclipse kept trying to use the 32 bit one.

  6. fernando-correia on May 18, 2012

    One of the easy ways to resolve it is to copy jre folder from installed JDK into Eclipse installation folder. Make sure that JDK you copy from is the same architecture as you Eclipse installation.

    I had to configure my machine that way because I run both Eclipse and Appcelerator Titanium Studio on my machine. The Studio needs 32 bit Java, while Eclipse needs 64 bit.

  7. scott on May 18, 2012

    Thank you misterfrb, I realised that Eclipse was giving this error becasue I had just installed Oracle 10g Developer suite and it was looking for the jvm.dll file in the C:DevSuiteHome_1 folder (I must have opted to install JDK again along with developer suite). After removing the DevSuiteHome lines from the paths variable and adding the correction location for 64bit jvm.dll (not sure if this was necessary, didn’t try without), eclipse worked again, and Dev Suite still does too.

  8. johan-offer on May 18, 2012

    As many folks already alluded to, this is a 32 vs. 64 bit problem for both eclipse and java. You cannot mix up 32 and 64 bit. Since eclipse doesn’t use JAVA_HOME, you’ll likely have to alter your PATH prior to launching eclipse to ensure you are using not only the appropriate version of java, but also if 32 or 64 bit (or modify the ini file as Jayath noted). If you are installing eclipse from a company-share, you should ensure you can tell which eclipse version you are unzipping, and unzip to the appropriate Program Files directory to help keep track of which is which, then change the PATH (either permanently via (windows) Control Panel -> System or set PATH=/path/to/32 or 64bit/java/bin;%PATH% (maybe create a batch file if you don’t want to set it in your sytem and/or user environment variables). Remember, 32bit is in Program files (x86).

    If unsure, just launch eclipse, if you get the error, change your PATH to the other ‘bit’ version of java, then try again. Then move the eclipse directory to the appropriate PF directory.

  9. xequnsruuh on May 18, 2012

    Had exactly the same problem.
    Downloaded the 64-bit java and 64-bit Eclipse and solved it:
    http://www.java.com/en/download/manual.jsp

  10. harry on May 18, 2012

    Alternatively, get the same “bit” version of JRE and eclipse and then create a new Shortcut with the below Target (Replace the installed JRE & eclipse location/path):

    “C:studioeclipse.exe” -vm “C:Program FilesJavajre7binserverjvm.dll” eclipse.vm=”C:Program FilesJavajre7binserverjvm.dll” java.home=”C:Program FilesJavajre7″ java.runtime.version=1.7.0

    That should do the trick.

  11. joseph on May 18, 2012

    Sure you need to have compatible version of JDK and Eclipse, but you also need to add in the eclipse.ini file the below lines: -
    -vm
    yourdrivejavabin

    make them the first 2 lines of your eclipse.ini file.

    Hope it helps.
    Thanks

  12. fernando-correia on May 18, 2012

    Yes just make sure your versions of eclipse and jdk are both 64bit. Just to make sure everything is correct uninstalled jdk and install it in Program Files and not in Program Files (x86). Atleast that resolved my problem.