64位系统下同时使用64位和32位的eclipse
The -vm option and its value (the path) must be on separate lines.
The value must be the full absolute or relative path to the Java executable, not just to the Java home directory.
The -vm option must occur before the -vmargs option, since everything after -vmargs is passed directly to the JVM.
For the 32-bit Eclipse executable (eclipse.exe on Windows) a 32-bit JVM must be used and
for the 64-bit Eclipse executable a 64-bit JVM must be used.
32-bit Eclipse will not work with a 64-bit JVM.
要所有的软件,硬件,全是64位的,你的应用才算成功的运行在64位上了。比如:
使用64位的CPU,现在(2006年以后生产)的CPU都是64位。
安装64位的操作系统,比如64位的windows 7
安装64位的JDK,比如jdk-6u25-windows-x64.exe
安装64位的eclipse,比如eclipse-jee-helios-SR2-win32-x86_64.zip
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..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
http://blog.csdn.net/wangxianshou/article/details/7409293
实际上,JDK环境配置好之后,选择一个适合操作系统的Eclipse版本,启动Eclipse就能根据
环境变量自动寻找JDK,并成功运行。
下面是我的弯路历程,总结一下,希望别人可以少走弯路。
我安装前手头的环境
=========================================================================
操作系统 win7 64bit
JDK:jdk-7u3-windows-i586
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html
Eclipse:eclipse-SDK-4.1-win32-x86_64
http://www.eclipse.org/downloads/
=========================================================================
先把jdk安装上,然后设置好java环境后,test没有问题
然后把Eclipse解压开,然后进入Eclipse目录中双击 eclipse 时
启动不开,报 Failed to load the JNI shared library jvm.dll 错误。
网上查阅 http://www.oschina.net/question/12_26790
指点 换成 64位的jdk,就能解决
于是乎,下载64位jdk jdk-7u3-windows-x64
安装好后,仍然报这个错误,
接下来把之前安装的32位的java环境删掉(开始,控制面板,卸载程序,32位java环境相关软件)
再启动Eclipse,终于正常了。
How to reconfigure eclipse to use a 64 bit JVM
I'm using eclipse on what I thought were all 64 bit runtime environments.
The current settings Java>installed JREs and Execution Environment all point to jdk1.6.0_30 which is a 64 bit version of the JDK.
However, eclipse still thinks it's running a 32 bit version because when I run:
System.getProperty("sun.arch.data.model");
it returns 32 instead of 64.
And the external JNI resource that I compiled for 64 bit machines will not link to the shared .so file unless it's running in a 64 bit enviroment. (I'm getting word size mismatch errors when I try to do this)
So How can I reconfigure eclipse to run 64 bit jvm. Does eclipse itself have to be a 64 bit version?
:on linux
Edit: I have tried everyone's suggestions and nothing is working. I've changed the execution, and enviroment variables to point to the newst JDK I have which is 1.6_30. when I run the program from a command line I get 64 and amd64 as the value when I run the same program in eclise I get 32 and i386. Something is wrong in eclipse that is causing it to try and run it on a 32 bit JVM. when I try java -d32 -version it says that a 32 bit enviroment isn't installed but Eclipse doesn't know that. I've modified the Eclipse.ini file and still nothing is working. I've restarted eclipse after these changes...nothing. Can some one who knows eclipse well people help me out here. thanks
Add the -vm tag to eclipse.ini or the shortcut to explicitly specify a JRE. Note that the default for Windows XP is to use the CRAPPY JRE that comes with Windows.
-vm "%JAVA_HOME%/bin/javaw.exe"
Note
that the format in eclipse.ini is to have -vm on one line and the value on the next.. I'm not sure why...
-Xmx8g
-d64
The "installed JREs" (better use JDKs) are used for building and running your code
and can be of different architecture or Java version.
The JVM used for running Eclipse is defined in the eclipse.ini file.
You should use the version for the architecture of the JVM.
Okay.
This has been rather headache inducing, but I believe I have a solution.
After changing the eclipse.ini, Go to your project properties.
Under the Run/Debug settings, edit the launch configuration for your project.
Under the JRE tag, click installed JREs.
When that dialog comes up, click search.
Go to your program files folder, NOT the x86 one, and let it search for your JREs.
When the latest comes up, deselect the JRE that was currently selected and select the most recent JRE that it found.
I renamed mine JRE7-64 just so I could identify a difference. This solved the issue on my end. Good luck
64位系统下同时使用64位和32位的eclipse的更多相关文章
- 64位系统下找不到office 32位组件
如果系统式64位的,而装的是32位的office软件,在运行栏中输入命令:dcomcnfg,打开组件服务管理窗口,但是却发现找不到Microsoft Excel程序, 这主要是64位系统的问题,exc ...
- 外网win10 64位环境下 为内网win7 32位安装三方包的最靠谱手段:python64位、32位全安装。
经过一周的各种折磨,如题.以下是我的经验和教训. 我的外网是win10 64位,内网环境win7 32位.由于未知原因,anaconda无法安装!!! 其实最靠谱的安装三方包的还是whl包.但是很有可 ...
- 无光驱在32位windows系统下安装64位windows系统
位的系统. 大家都知道,32位的操作系统最多只能支持3.2G的内存,现在内存白菜价,很多人都在原有基础上购入新内存,这样最少也有4G了,为了让内存不浪费,我 们只有升级到64位操作系统.但是很多朋友又 ...
- (原)解决.NET 32位程序运行在64位操作系统下的兼容性问题
背景:一个第三方组件是C++.NET 32位开发的,后被C#(基于FrameWork4.0)调用并封装成组件,此二次封装的组件无法运行于64位操作系统上. 开发环境:VS2012:解决 ...
- 64位系统下注册32位dll文件
64位系统下注册32位dll文件 在64位系统里注册32位软件所需的一些dll会提示不兼容,大概因为32 位进程不能加载64位Dll,64位进程也不可以加载32的导致. 若要支持的32 位和64 位C ...
- PL/SQL Developer 在windows7 64位系统下连Oaracle11g64位系统的解决经验
PL/SQL Developer 在windows7 64位系统下连Oaracle11g64位系统的解决经验 一.问题现象及解决方法 现象: 1.PL/SQL 无法登录64位数据库 2.在PL/SQL ...
- 64位系统下System32文件系统重定向
前言 因为一次偶然的机会,需要访问系统目录“C:/Windows/System32“文件夹下的内容,使用的测试机器上预装了win7 64系统.在程序运行中竟然发生了该文件路径不存在的问题!!通过查看网 ...
- 64位系统/32位系统下/8位CPU的数据宽度
不同的编译器根据不同的 64 位模型有所不同. 比如 Visual C++,从第一个支持 64 位的版本起,一直就是使用 LLP64 内存模型,也就是说,编译出的代码除了 long 和指针是 64 位 ...
- Installshield 64位操作系统下拷贝文件,如何重定向到32位的系统文件夹下
原文:Installshield 64位操作系统下拷贝文件,如何重定向到32位的系统文件夹下 64位操作系统下拷贝文件重定向问题,在在复制代码前加上Disable(WOW64FSREDIRECTION ...
随机推荐
- 010 JVM类加载
转自http://www.importnew.com/23742.html 前言 我们知道我们写的程序经过编译后成为了.class文件,.class文件中描述了类的各种信息,最终都需要加载到虚拟机之后 ...
- 程序调试命令gdb
锁定线程 set scheduler-locking 1.要使用此命令,先用gcc -g编译程序,如: $gcc -g test.c -o test 编译test.c源程序,输入此程序的调试版本t ...
- 用PHP去实现数据库查询结果缓存
有些时候我们希望减少对数据库的查询来提高程序的性能,因为这些数据不是经常变更的,而是会在很长一段时间内都不会变化,因此,我们每连接一次数据库,都会把相应的结果用文件的形式保存起来.比如对于一个商城来说 ...
- EasyUi–8.datebox赋值的问题
这个问题要从EasyUI的datebox组件说起,小菜用这个组件的时候,发现用$("#id").val()这种形式,居然拿不到文本框的值! 经过度娘的帮助,发现可以用$(" ...
- 【51nod】1340 地铁环线
今天头非常疼,躲在家里没去机房 反正都要颓废了,然后花了一上午研究了一下这道神题怎么做-- 题解 首先我们发现,如果我们设\(dis[i]\)为从\(0\)节点走到\(i\)节点的距离 那么题目中给出 ...
- CentOS7.5 firefox Flash插件更新
CentOS7自带的firefox没有flash插件,所以是没有办法在网页上看视频的,需要自己手动安装 1.下载 打开flash官网https://get.adobe.com/flashplayer/ ...
- php将长字符串拆分为指定最大宽度的字符串数组
/** * 将字符串拆分为指定最大宽度的字符串数组.单字节字符宽度为1,多字节字符通常宽度为2 * @param string $msg 要拆分的字符串 * @param int $width 结果数 ...
- Redis实战(一)
一.准备 Redis 是一个开源的使用ANSI C 语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value 数据库.Redis的出现,很大程度补偿了memcached这类key/valu ...
- 【Java】 奇偶数的判断
判断方法(奇数): 错误判断方法:通过a%2==1来判断.(原因:负奇数对2取余的结果为-1) 正确判断方法:(1) 通过a%2!=0来判断. (2) ...
- 搭建samba 共享openstack开发环境
centos7.2 openstack环境为allinone 模式,这样跑代码好处理 安装smb [root@controller ~]# yum install -y samba samba-cli ...