64位系统下同时使用64位和32位的eclipse

eclipse.ini 文件使用说明

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.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  

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相关推荐

  1. WIN7 64位操作系统下成功安装Oracle10g(32位)

    在win7系统下安装Oracle ,有以下几点需要注意: Java代码  1.需用administrator 用户下安装.    2.因为oracle 10g暂时没有与win7兼容的版本,我们可以通过 ...

  2. centos 64位linux系统下安装appt(只有32位)命令的apktool工具包的笔记

    centos 64位linux系统下安装appt命令的apktool工具包的笔记,有需要的朋友可以参考下. 首先,安装apktool包 1. wget http://android-apktool.g ...

  3. 【解决方案】64位Linux系统下无法编译、运行32位C、C++程序的解决办法

    [故障] 1. 从32位系统里面复制过来的32位C或C++程序无法运行,提示找不到程序文件,或找不到libstdc++.so.6库 [oct1158@oct1158-fedora 32env]$ ./ ...

  4. 外网win10 64位环境下 为内网win7 32位安装三方包的最靠谱手段:python64位、32位全安装。...

    经过一周的各种折磨,如题.以下是我的经验和教训. 我的外网是win10 64位,内网环境win7 32位.由于未知原因,anaconda无法安装!!! 其实最靠谱的安装三方包的还是whl包.但是很有可 ...

  5. 32位linux安装64位工具链,在64位系统(GNU工具链)上组装32位二进制文件

    使用gcc -m32. .code32是吗?不更改输出文件格式,这就是程序运行模式的决定因素.不尝试在64位模式下运行32位代码是由您自己决定的..code32用于组装您可能希望作为数据的" ...

  6. 64位linux nvidia 32位,赶紧升级到64位操作系统吧,NVIDIA不再提供32位显卡驱动

    拼 命 加 载 中 ... 原本以为NVIDIA只是对老旧显卡不再提供32位驱动而已,但在下载驱动时候惊奇发现,NVIDIA官网上已经对全系列显卡不再提供32位驱动,而只有GeForce上面仍保留有3 ...

  7. 你为什么需要在64位系统下用32位程序

    在64位系统下,用64位的程序自然是能够充分利用cpu中的64位指令和64位的地址空间,可有的时候,我们却不得不在64位系统下使用32位的程序. 64位和32位 对于64位还是32位,首先要从概念上把 ...

  8. python3.7 win10 64位系统下用pyinstaller打包的程序在32位系统下无法运行

    问题背景: 在64位的win10系统下,用python 3.7.4 写了个定时报警的小玩意儿,主要用到了pyaudio模块,写完之后,使用pyinstaller打包成.exe文件,在其他64位的电脑下 ...

  9. 64位系统下用32位程序

    在64位系统下,用64位的程序自然是能够充分利用cpu中的64位指令和64位的地址空间,可有的时候,我们却不得不在64位系统下使用32位的程序. 64位和32位 对于64位还是32位,首先要从概念上把 ...

最新文章

  1. 统计学习方法笔记(一)-k近邻算法原理及python实现
  2. 汇编 debug调试
  3. [css] 异步加载CSS的方式有哪些?
  4. POJ 2288 Islands and Bridges(状压dp)
  5. 大开眼界百度云盘2018_文化差异的大开眼界
  6. 跟我学AI建模:分子动力学仿真模拟之DeepMD-kit框架
  7. 基于CentOS7配置ArcGIS enterprise
  8. 为什么我偏爱用 GitHub 来写书?
  9. 计算机不用鼠标怎么移动,如何在不使用鼠标的情况下拖动文件
  10. 全球与中国高密度聚乙烯塑料桶市场深度研究分析报告
  11. 基于高德地图导航的路径爬取
  12. 来自和府捞面的信任,一起见证「客户的成功就是璞华的成功」
  13. 中国各城市首轮感染高峰期预测!(最新更新版)
  14. 辉芒微FT61F023,FT61F011A
  15. 绕cdn找源站ip(提供思路)
  16. 招沿实业学生怎样才能做好投资理财工作
  17. SQL Server数据库实操 第二波 集合查询、datepart()
  18. java中子类会继承父类的构造方法吗
  19. win10/win11家庭版解压缩时,出现错误代码0x80004005的解决办法
  20. Tik Tok跨境:进军海外市场怎么选择支付方式

热门文章

  1. ajax使用post函数(通过远程 HTTP POST 请求载入信息)
  2. OFD文件打开、打印设置,看这篇就够了
  3. java2048小游戏源码及解析_200行java代码实现2048小游戏
  4. 安卓如何实现动态广告栏
  5. 自定义Spark累加器
  6. Ring Buffer 的应用
  7. 解析 通证经济的分类及用途
  8. 数据库oracle--PL/SQL的使用-如何按f8只执行一行
  9. 数据分析在互联网金融的应用
  10. MAC修改主机名、计算机名