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?
-vm C:\Program Files (x86)\Java\jre6\bin\javaw.exe
doesn't work. Any ideas?
There are TWO JVM's in action when developing with Eclipse. One running Eclipse itself, and the other one used for your program.
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).
If the JVM used by your applications change, you are done.
If not, you should start with a new workspace, add the 32-bit JVM and create your projects as before.
Take a look at this page:
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).
Did you change you installed VMs?
Window -> Preferences -> Java -> Installed JREs
There can be the 64bit VM.
With the -vm parameter you specify the JRE to start Eclipse. With the installed VMs you specify the VM to run you code.
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.
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.
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.
Don't forget to set: JAVA_HOME: .;JDK32 PATH\bin;JDK64 PATH\bin
PATH: .;JDK32 PATH\bin;JDK64 PATH\bin
It's always good to put the .; first in the value of your new environment variables
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.
精彩评论