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. js固定小数位数 .toFixed()

    toFixed(num)法可把 Number 四舍五入为指定小数位数的数字. num为需要固定的位数 var num=2;console.log(num.toFixed(2));//2.00;var ...

  2. pandas安装及使用

    一. 安装pandas1. Anaconda        安装pandas.Python和SciPy最简单的方式是用Anaconda.Anaconda是关于Python数据分析和科学计算的分发包.2 ...

  3. VMware-workstation-6.5.2-156735.exe

    480HD-KPZ2X-TA56C-4YTQQ VMware 12 专业版永久许可证密钥 5A02H-AU243-TZJ49-GTC7K-3C61N

  4. 用OpenSSL命令行生成证书文件

    用OpenSSL命令行生成证书文件 1.首先要生成服务器端的私钥(key文件): openssl genrsa -des3 -out server.key 1024 运行时会提示输入密码,此密码用于加 ...

  5. xss 过滤

    一. xss过滤 用户通过Form获取展示在终端, 提交数据,Form验证里面加入xss验证(对用户提交的内容验证是否有关键标签) from django.conf.urls import url f ...

  6. android Webview Html5 相关文章

    Android WebView的使用集锦(支持Html5) http://blog.csdn.net/l_215851356/article/details/69239643 WebView详解与简单 ...

  7. IEEEXtreme 10.0 - Game of Stones

    这是 meelo 原创的 IEEEXtreme极限编程大赛题解 Xtreme 10.0 - Game of Stones 题目来源 第10届IEEE极限编程大赛 https://www.hackerr ...

  8. 原生js粘贴复制【源码】

    <html> <head> <meta charset="UTF-8"> <title>9行代码实现复制内容至剪切板</tit ...

  9. Asp.net gzip压缩的启用

    gzip压缩使用一种压缩算法,对网页内容进行压缩,从而减小了网页体积.使用gizp压缩后减小了服务器的带宽.提高了网页的打开速度.下边看看我找到的一个asp.net中启用gzip压缩方案. 首先,我们 ...

  10. CentOS7 Nodejs布署环境

    一.服务器设置:https://www.youtube.com/watch?v=1OU5ngq-WyM&list=PLQlWzK5tU-gDyxC1JTpyC2avvJlt3hrIh& ...