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..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. 64位系统下找不到office 32位组件

    如果系统式64位的,而装的是32位的office软件,在运行栏中输入命令:dcomcnfg,打开组件服务管理窗口,但是却发现找不到Microsoft Excel程序, 这主要是64位系统的问题,exc ...

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

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

  3. 无光驱在32位windows系统下安装64位windows系统

    位的系统. 大家都知道,32位的操作系统最多只能支持3.2G的内存,现在内存白菜价,很多人都在原有基础上购入新内存,这样最少也有4G了,为了让内存不浪费,我 们只有升级到64位操作系统.但是很多朋友又 ...

  4. (原)解决.NET 32位程序运行在64位操作系统下的兼容性问题

    背景:一个第三方组件是C++.NET  32位开发的,后被C#(基于FrameWork4.0)调用并封装成组件,此二次封装的组件无法运行于64位操作系统上.        开发环境:VS2012:解决 ...

  5. 64位系统下注册32位dll文件

    64位系统下注册32位dll文件 在64位系统里注册32位软件所需的一些dll会提示不兼容,大概因为32 位进程不能加载64位Dll,64位进程也不可以加载32的导致. 若要支持的32 位和64 位C ...

  6. PL/SQL Developer 在windows7 64位系统下连Oaracle11g64位系统的解决经验

    PL/SQL Developer 在windows7 64位系统下连Oaracle11g64位系统的解决经验 一.问题现象及解决方法 现象: 1.PL/SQL 无法登录64位数据库 2.在PL/SQL ...

  7. 64位系统下System32文件系统重定向

    前言 因为一次偶然的机会,需要访问系统目录“C:/Windows/System32“文件夹下的内容,使用的测试机器上预装了win7 64系统.在程序运行中竟然发生了该文件路径不存在的问题!!通过查看网 ...

  8. 64位系统/32位系统下/8位CPU的数据宽度

    不同的编译器根据不同的 64 位模型有所不同. 比如 Visual C++,从第一个支持 64 位的版本起,一直就是使用 LLP64 内存模型,也就是说,编译出的代码除了 long 和指针是 64 位 ...

  9. Installshield 64位操作系统下拷贝文件,如何重定向到32位的系统文件夹下

    原文:Installshield 64位操作系统下拷贝文件,如何重定向到32位的系统文件夹下 64位操作系统下拷贝文件重定向问题,在在复制代码前加上Disable(WOW64FSREDIRECTION ...

随机推荐

  1. [转载]FFmpeg完美入门[4] - FFmpeg应用实例

    1 用FFserver从文件生成流媒体 一.安装ffmpeg 在ubuntu下,运行sudo apt-get ffmpeg 安装ffmpeg,在其他linux操作系统下,见ffmpeg的编译过程(编译 ...

  2. BootStarp的form表单的基本写法

    代码如下: <!DOCTYPE html> <html> <head> <title>BootStrap的基础入门</title> < ...

  3. reverse和reverse_copy函数的应用

    reverse函数的作用是:反转一个容器内元素的顺序.函数参数:reverse(first,last);//first为容器的首迭代器,last为容器的末迭代器.它没有任何返回值. 这个函数比较简单, ...

  4. spring源码分析---事务篇

    上一篇我介绍了spring事务的传播特性和隔离级别,以及事务定义的先关接口和类的关系.我们知晓了用TransactionTemplate(或者直接用底层P的latformTransactionMana ...

  5. 20165301 2017-2018-2 《Java程序设计》第八周学习总结

    20165301 2017-2018-2 <Java程序设计>第八周学习总结 教材学习内容总结 第十二章:Java多线程机制 进程与线程 操作系统与进程:进程是程序的一次动态执行过程. 进 ...

  6. python selenium自动化测试之路(1)--分层测试概念、selenium工具介绍

    1.分层自动化测试概念 传统的自动化市场更关注产品UI层的自动化测试,而分层的自动化测试倡导产品开发的不同阶段都需要自动化测试 大多公司与研发团队其实是忽略了单元测试与集成测试阶段的自动化测试工作,所 ...

  7. Hadoop案例(五)过滤日志及自定义日志输出路径(自定义OutputFormat)

    过滤日志及自定义日志输出路径(自定义OutputFormat) 1.需求分析 过滤输入的log日志中是否包含xyg (1)包含xyg的网站输出到e:/xyg.log (2)不包含xyg的网站输出到e: ...

  8. WERTYU(UVa10082)

    C++ 11 代码如下: #include<iostream> using namespace std; const char s[] = { "`1234567890-=QWE ...

  9. bzoj 1877 最小费用流

    思路:挺裸的费用流,拆拆点就好啦. #include<bits/stdc++.h> #define LL long long #define fi first #define se sec ...

  10. Linux的经典shell命令整理

    Linux的经典shell命令整理 1.删除0字节文件find -type f -size 0 -exec rm -rf {} \; 2.查看进程按内存从大到小排列ps -e -o “%C : %p ...