转自: http://blog.csdn.net/jacarri/article/details/9785683
32位JDK安装目录是D:\Java\32\jdk1.6.0_13
64位JDK安装目录是D:\Java\jdk1.7.0_06
JAVA_HOME配置的是JAVA_HOME=D:\Java\32\jdk1.6.0_13
然后启动64位的eclipse果断的报错了,报错信息:[Failed to load the JNI shared library "D:\Java\32\jdk1.6.0_13\bin\..\jre\bin\client\jvm.dll".],想到环境变量配置的是32位的JDK,果断的确认是eclipse使用了默认的配置,要解决这个问题就要在64位eclipse.ini中指定jvm的位置.
配置方法如下:
在eclipse.ini文件中找到openFile,在下面添加如下两行:
- -vm
- D:/Java/jdk1.7.0_06/bin/javaw.exe
注意上面两行不能写在同一行上哟.
为了保证以后将环境变量的jdk切换到64位后,32位的eclipse报错,所以顺便32位的eclipse的配置文件也做了类似的配置
如果改配置后出现这个错误[Java was started but returned exit code=13] ,可能是你给64位的eclipse指定了32位的jvm.
上我64位eclipse使用的配置文件
- -startup
- plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
- --launcher.library
- plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
- -product
- org.eclipse.epp.package.java.product
- --launcher.defaultAction
- openFile
- --launcher.XXMaxPermSize
- 256M
- -showsplash
- org.eclipse.platform
- --launcher.XXMaxPermSize
- 256m
- --launcher.defaultAction
- openFile
- -vm
- D:/Java/jdk1.7.0_06/bin/javaw.exe
- -vmargs
- -Dosgi.requiredJavaVersion=1.5
- -Xms40m
- -Xmx384m
- -XX:PermSize=256M
- -XX:MaxPermSize=256M
- -verbose:gc
- -XX:+PrintGCDetails
- -XX:+PrintGCDateStamps
- -Xloggc:D:/application/eclipse-android/gc.log
上32位eclipse使用的配置文件
- -startup
- plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
- --launcher.library
- plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
- -product
- org.eclipse.epp.package.jee.product
- --launcher.defaultAction
- openFile
- --launcher.XXMaxPermSize
- 256M
- -showsplash
- org.eclipse.platform
- --launcher.XXMaxPermSize
- 256m
- -vm
- D:/Java/32/jdk1.6.0_13/bin/javaw.exe
- --launcher.defaultAction
- openFile
- -vmargs
- -Dosgi.requiredJavaVersion=1.5
- -Xms40m
- -Xmx512m