Java 在 Windows 64 位上使用 32 位 jvm 运行 32 位 eclipse
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4240631/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Running 32bit eclipse with 32bit jvm on windows 64bit
提问by Tamas
One of the .jar files I am using only works with the 32-bit java virtual machine on windows. I installed the 32bit versions of eclipse and the jdk but it is still getting the same error. What commands would I use in the run configuration to specify 32-bit virtual machine for running the application that uses this .jar file?
我使用的 .jar 文件之一仅适用于 Windows 上的 32 位 java 虚拟机。我安装了 32 位版本的 eclipse 和 jdk,但仍然出现相同的错误。我将在运行配置中使用哪些命令来指定 32 位虚拟机来运行使用此 .jar 文件的应用程序?
-vm C:\Program Files (x86)\Java\jre6\bin\javaw.exe
-vm C:\Program Files (x86)\Java\jre6\bin\javaw.exe
doesn't work. Any ideas?
不起作用。有任何想法吗?
回答by Thorbj?rn Ravn Andersen
There are TWOJVM's in action when developing with Eclipse. One running Eclipse itself, and the other one used for your program.
使用 Eclipse 进行开发时,有两个JVM 正在运行。一个运行 Eclipse 本身,另一个用于您的程序。
Unless you are talking about a plugin, it is the latter you need to worry about. Remove the -vm option so Eclipse starts with the default JRE. Then go to Preferences -> Java -> Installed JRE's and add your 32 bit Java installation and set it to be default (this is the trick).
除非您在谈论插件,否则您需要担心的是后者。删除 -vm 选项,以便 Eclipse 以默认 JRE 启动。然后转到 Preferences -> Java -> Installed JRE's 并添加您的 32 位 Java 安装并将其设置为默认值(这是技巧)。
If the JVM used by your applications change, you are done.
如果您的应用程序使用的 JVM 发生变化,您就大功告成了。
If not, you should start with a new workspace, add the 32-bit JVM and create your projects as before.
如果没有,您应该从一个新工作区开始,添加 32 位 JVM 并像以前一样创建您的项目。
回答by Christian Kuetbach
Take a look at this page:
看看这个页面:
http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F
http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F
If you specify your VM within the eclipe.ini it have to be in a special line (I think).
如果你在 eclipe.ini 中指定你的 VM,它必须在一个特殊的行中(我认为)。
Did you change you installed VMs?
您是否更改了安装的虚拟机?
Window -> Preferences -> Java -> Installed JREs
窗口 -> 首选项 -> Java -> 已安装的 JRE
There can be the 64bit VM.
可以有 64 位 VM。
With the -vm parameter you specify the JRE to start Eclipse. With the installed VMs you specify the VM to run you code.
使用 -vm 参数指定 JRE 以启动 Eclipse。使用已安装的 VM,您可以指定 VM 来运行您的代码。
回答by Leobons
The are a lot of version of the virtual machine so let's go by all of them:
虚拟机有很多版本,让我们来看看它们:
JRE 32 bit, JRE 64 bit, JDK 32 bit, JDK 64 bit.
JRE 32 位、JRE 64 位、JDK 32 位、JDK 64 位。
If you have a 64 bit OS, you should be able to all of them and that's what I have installed in my machine, but there's an order you have to follow, the order I just described, first JRE 32 bit, then JRE 64, JDK32, JDK64. Other orders of installation may cause problems. Just in case, I'd recommend you to remove every virtual machine you have installed (JavaRa makes it easier: http://singularlabs.com/software/javara/javara-download/) and then proceed to the installation in the order described.
如果你有一个 64 位的操作系统,你应该能够使用所有的操作系统,这就是我在我的机器上安装的,但是你必须遵循一个顺序,我刚刚描述的顺序,首先是 JRE 32 位,然后是 JRE 64, JDK32、JDK64。其他安装顺序可能会导致问题。以防万一,我建议您删除已安装的每个虚拟机(JavaRa 使其更容易:http://singularlabs.com/software/javara/javara-download/ ),然后按照描述的顺序进行安装.
There are some reasons you wanna run a 32 bit Eclipse even if you have a 64 bit OS and one of them is that there are some suites and tools that do not support the 64 bit version.
即使您拥有 64 位操作系统,您也有一些原因想要运行 32 位 Eclipse,其中之一是有些套件和工具不支持 64 位版本。
Don't forget to set: JAVA_HOME: .;JDK32 PATH\bin;JDK64 PATH\bin
不要忘记设置:JAVA_HOME: .;JDK32 PATH\bin;JDK64 PATH\bin
PATH: .;JDK32 PATH\bin;JDK64 PATH\bin
路径:.;JDK32 PATH\bin;JDK64 PATH\bin
It's always good to put the .; first in the value of your new environment variables
把 . 放在一边总是好的。首先是你的新环境变量的值
回答by A. Markóczy
The JVM you are using to run your project in eclipse is defined at your project's "run configuration", click right on your project then choose "Run as" then "Run configurations...". In the window that opens, make sure that your main class (the one you use to start the program) is selected in the menu on the left side, choose the Tab "JRE" and choose the according JRE (in your case, the 32 bit version). Close the window by clicking "run" to see if it worked.
您用于在 Eclipse 中运行项目的 JVM 是在项目的“运行配置”中定义的,右键单击您的项目,然后选择“运行方式”,然后选择“运行配置...”。在打开的窗口中,确保在左侧菜单中选择了您的主类(用于启动程序的类),选择选项卡“JRE”并选择相应的 JRE(在您的情况下为 32位版本)。单击“运行”关闭窗口以查看它是否有效。