解决Failed to load the JNI shared library xxx/xxx/jvm.dll 错误

image

原因:jdk发生变化(新装了32位jdk),eclipse在启动时使用了 系统环境变量中的jdk路径(32位).

解决:只要把旧的64位的jre路径指定给eclipse启动文件即可。

在eclipse.ini中,第一行增加

-vm
D:/Server/Java64/jre7/bin/javaw.exe

 

Eclipse和MyEclipse启动时对jre依赖的区别:

  • myeclipse2013的启动依赖自身带的jre环境

#utf8 (do not remove)
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.i18n.win32.win32.x86_64_3.2.0.v201103301700

-vm
binary/com.sun.java.jdk.win32.x86_64_1.6.0.u43/bin/javaw.exe

-install
D:ServerMyEclipse2013
-vmargs
-Xmx512m
-XX:MaxPermSize=256m
-XX:ReservedCodeCacheSize=64m
-Dosgi.nls.warnings=ignore

  • eclipse的启动 要求安装jre,并首先考虑使用eclipse.ini指定的jre中的javaw.exe, 若找不到会在环境变量中的javaw.exe

-vm
D:/Server/Java64/jre7/bin/javaw.exe

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20150204-1316
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m

 

需要注意的是,eclipse版本若是32位的,那么jre也应该是32位的。也就是说要对应起来,不然无法启动的。

原文地址:https://www.cnblogs.com/qq-757617012/p/4487114.html