Failed to load the JNI shared Library (JDK)

2018-12-31 08:56发布

When I try opening Eclipse, a pop-up dialog 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 Java SE Development Kit are both 64-bit. I checked my system, and it can handle 64-bit.
  • I've searched for this problem on Google and on Stack Overflow, 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.
What would be suggested to solve this issue?

30条回答
流年柔荑漫光年
2楼-- · 2018-12-31 09:01

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 versions of Java installed, but Eclipse kept trying to use the 32-bit one.

查看更多
荒废的爱情
3楼-- · 2018-12-31 09:01

Simple, I have a 64-bit OS, 32-bit Eclipse and both JDK 32 & 64 installed... I just uninstalled the 64-bit JDK and Eclipse is working fine..

查看更多
梦该遗忘
4楼-- · 2018-12-31 09:03

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.

查看更多
人气声优
5楼-- · 2018-12-31 09:04

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.

查看更多
不流泪的眼
6楼-- · 2018-12-31 09:04

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.

查看更多
后来的你喜欢了谁
7楼-- · 2018-12-31 09:08

And for PDT users - avoid the Zend download page - it doesn't have any 64-bit downloads linked.

Use the Elipse site itself.

The above link had an older 3.6 Eclipse which then failed to update itself due to Eclipse Bug #317785.

My solution was to just install 32-bit Java alongside 64-bit - this allowed the Zend installer to work.

It's depressing that amount of Java / Eclipse cruft one has to go through to get a PHP IDE.

查看更多
登录 后发表回答