当我尝试打开Eclipse时,弹出对话框显示:

加载JNI共享库“C:/JDK/bin/client/jvm.dll”失败。

在此之后,Eclipse部队关闭。

以下是我想说的几点:

我查了下那条路径上有没有东西。它确实存在。 我的Eclipse和Java SE Development Kit都是64位的。我检查了我的系统,它可以处理64位。 我在谷歌和Stack Overflow上搜索过这个问题,我找到的唯一答案是下载32位版本的JDK和Eclipse。

下载32位版本是我想做的最后一件事。 如何解决这个问题?


当前回答

这个错误意味着Eclipse的体系结构与Java运行时的体系结构不匹配,即如果一个是32位的,另一个必须是相同的,而不是64位的。

最可靠的修复方法是在eclipse.ini中指定JVM位置:

-vm
C:\Program Files (x86)\Java\jdk1.7.0_55\bin\javaw.exe

重要:这两行必须在-vmargs之前。不要使用引号;允许使用空格。

其他回答

确保您的eclipse.ini文件包含以下几行。

-vm
C:\path\to\64bit\java\bin\javaw.exe

以eclipse.ini为例:

-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 Files\Java\jdk1.6.0_32\bin\javaw.exe
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

使用64位或32位的操作系统和Eclipse保持一致,并配置Eclipse .ini。

您的eclipse.ini文件可以在eclipse文件夹中找到。

您可以解决这个问题,因为许多其他复制。您需要Eclipse和JDK都是32位的,或者都是64位的。操作系统的架构并不重要,而其他的仍然是相同类型的架构。

上面的答案让我很感兴趣,所以我决定演练一下OS、Eclipse和JVM三人组的所有可能组合。无论如何,无论谁正在深入研究和阅读我的帖子,检查以下作为一个热点(我是Windows 7用户)。

You understand Program Files and Program File (x86) are two different folders... x86 stands for the 32-bit version of programs and the former is the 64-bit version. If you have multiple versions of Java installed with different bitness and release versions, which is bound to happen with so many open source IDEs, managers, administrative consoles, the best option is to set the VM argument directly in the eclipse.ini file. If you don't, Eclipse will go crazy and try searching itself which is not good.

在Eclipse的下载页面上,应该写“JRE 32位”或“JRE 64位”,而不是“Windows 32位”或“Windows 64位”。

请确保使用与您的JDE兼容的正确版本,如前所述。

另一种选择是:

创建Eclipse.exe的快捷方式。打开快捷方式,将目标更改为:

"C:\Program Files\eclipse\eclipse.exe" -vm "c:\Program Files\Java\jdk1.7.0_04\bin\javaw.exe"

对于您的安装,请确保位置指向正确的Eclipse安装目录和正确的javaw.exe安装目录。

(当然,Eclipse和Java的64/32位版本必须相同。)