32bit eclipse and 64bit java program

陌路散爱 提交于 2019-12-12 19:42:29

问题


  • I have a stable 32bit eclipse installation on my 64bit windows7 for android programming.
  • In parallel I am developing a simple java program ( non android, no jni's ) within the same eclipse ( 32bit ) that I should run in a 64 bit jvm ( needs more heap space ).

Is that possible ? ( I am asking, because I do not want to destroy my stable development environment by experimenting of installing 64bit and 32bit jvm in parallel )

The question in other words: Is it possible to run/launch ( green play icon in eclipse ) a java program in a 64bit jvm from a 32bit installed eclipse that was started in a 32bit jvm ?

regards


回答1:


I would strongly recommend:

1) Installing the 64-bit JDK (multiple different JDKs can all co-exist on the same host)

2) Fire up Eclipse, configure your project to use the 64-bit Java for its build and runtime paths ... and see what happens. It should work fine. Unless your program happens to use SWT (instead of Swing), or happens to have some other 32/64-bit dependency.

3) There's absolutely no harm in trying.

IMHO...

PS: It's worth noting that you can also have multiple versions of Eclipse co-existing on the same host. All you need is lots of disk space. And the hassle of re-installing your plugins and add-ons in both versions.




回答2:


Java code is compile in a byte code and its platform independent* (not always), unless you are using native libraries. Java compiler does not distinguish between 32 bit or 64 bit, its only when you run your java code in 64 bit VM that it takes advantage of additional things.




回答3:


There is not any problem. Usually we use the same Eclipse to run applications in 32-bits and 64-bits JVMs. You must (1) install in your computer the multiple versions of the JVM you are interested, (2) specify all of them in Eclipse, and (3) configure which JVM to use for each project.

  • By default, all your projects will run with the same JRE/JDK
  • You can specify all the Java runtimes you have in your computer using the menu Windows > Preferences > Java > Installed JREs. You can "Add" multiple JRE/JDKs there.
  • You can configure which JRE use for each project right-clicking on the project and selecting Build Path > Configure Build Path. You can select the root "JRE System Library", click on "Edit..." and select the JRE to use in the dialog box.


来源:https://stackoverflow.com/questions/17892740/32bit-eclipse-and-64bit-java-program

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!