Failed to load the JNI shared Library (JDK)

前端 未结 30 2357
自闭症患者
自闭症患者 2020-11-22 07:09

When I try opening Eclipse, a pop-up dialog states:

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

Follow

相关标签:
30条回答
  • 2020-11-22 07:43

    Working pairings of OS, JDK and Eclipse:


    • 32-bit OS | 32-bit JDK | 32-bit Eclipse (32-bit only)
    • 64-bit OS | 32-bit JDK | 32-bit Eclipse
    • 64-bit OS | 64-bit JDK | 64bit Eclipse (64-bit only)

    I had several JDKs and JREs installed.

    Each of them had their own entry in the PATH variable, all was working more or less.

    Judging from the PATH variables, some installations were completely useless, since they were never used. Of course, the "inactive" Javas could be referenced manually from within Eclipse if I needed, but I never did that, so I really did not need them. (At least I thought so at that time...)

    I cleaned up the mess, deinstalled all current Java's, installed only JDK + JRE 1.7 64-bit.

    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.

    The failing Eclipse was the only one of all my IDEs that was still a 32-bit version on my otherwise all-64-bit setup.

    Adding VM arguments, like so often mentioned, in the eclipse.ini was no use in my case (because I had only the wrong JDK/JRE to relate to.)

    I was also unable to find out how to check if this Eclipse was a 32-bit or 64-bit version (I could not look it up in the Task Manager, since this Eclipse 'installation' would not start up. And since it had been a while since I had set it up, I could not remember its version either.)

    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.

    0 讨论(0)
  • 2020-11-22 07:43

    I have multiple versions of Java installed, both Sun JDK & JRockit, both 32 bit and 64-bit, etc. and ran into this problem with a fresh install of 64-bit Eclipse for Java EE (JUNO).

    What did NOT work:

    64-bit trio as suggested by Peter Rader:

    I'm using 64-bit Eclipse on 64-bit OS (Windows 7).

    I ensured Sun JDK 7 64-bit was the default java version. When I typed "java -version" from command line (cmd.exe), Sun JDK 7 64-bit was returned...

    java version "1.7.0"
    Java(TM) SE Runtime Environment (build 1.7.0-b147)
    Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
    

    This did not resolve the problem for me.

    What DID work:

    Adding -vm option to eclipse.ini as suggested by Jayesh Kavathiya:

    I added the following to eclipse.ini:

    -vm
    C:/apps/java/jdk7-64bit/bin/javaw.exe
    

    Note:

    I did not have to uninstall any of the various versions of JDK or JRE I have on my machine.

    0 讨论(0)
  • 2020-11-22 07:44

    Alternatively, get the same "bit" version of JRE and Eclipse and then create a new shortcut with the below target (replace the installed JRE and Eclipse location/path):

    "C:\studio\eclipse.exe" -vm "C:\Program Files\Java\jre7\bin\server\jvm.dll" eclipse.vm="C:\Program Files\Java\jre7\bin\server\jvm.dll" java.home="C:\Program Files\Java\jre7" java.runtime.version=1.7.0
    

    That should do the trick.

    0 讨论(0)
  • 2020-11-22 07:46

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

    -vm
    yourdrive\java\bin
    

    Make them the first two lines of your eclipse.ini file.

    0 讨论(0)
  • 2020-11-22 07:46

    You can solve that problem as many other replicated. You need that Eclipse and the JDK be 32-bits or both on 64-bits. The architecture of the OS doesn't matter while the others remains on the same type of arquitecture.

    0 讨论(0)
  • 2020-11-22 07:46

    On the download page of Eclipse, it should be written "JRE 32 bits" or "JRE 64 bits" and not "Windows 32 bits" or "Windows 64 bits".

    Be sure to use the correct version compatible with your JDE, as answered previously.

    0 讨论(0)
提交回复
热议问题