Compile 32 bit Java builds on 64 bit machine with Eclipse

跟風遠走 提交于 2019-12-02 06:40:32

问题


so the questions as in the title, I need to run my server application in Tomcat on a System which is 32 bit Windows XP, I am working and compiling on my 64 bit Windows 7 in Eclipse. How do I compile it to 32 bit, what do I need to do? I assume it won't work on the 32 bit Windows when I'm compiling it on a 64 bit machine?


回答1:


Java doesn't build 32-bit or 64-bit applications - bytecode is portable across different bit architectures.

The only exception is native libraries that you might be using in your code. If there are any then you will have to manually compile those for the respective platform. Otherwise the java code is totally portable across 32-bit and 64-bit platforms.




回答2:


The problem is your JNI DLL, which needs to be compiled for 32-bit to match the 32-bit JRE.




回答3:


Java is independent of the OS.

You can compile with your 64bit machine and run this on a 32bit computer as long as this computer has a 32bit VM.




回答4:


If you're still searching for some "simple" solution, one would be to install a 32 bit os in a virtual machine and run eclipse from there.. Very ugly I know, but it works.

Another approach is mentioned here. How to launch java swing app which used precompled DLL from cmd?




回答5:


You could install a 32bits jdk on a 64bits machine. point the JAVA_HOME to this jdk and use it. It



来源:https://stackoverflow.com/questions/17145781/compile-32-bit-java-builds-on-64-bit-machine-with-eclipse

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