开发者

Java compiled on 32-bit OS runtime issues on 64-bit OS

Are there known issues with running a Java application compiled in a 32-bit machine and run 开发者_如何学Pythonon a 64-bit machine?


The byte code generated by a 32-bit JDK is identical to the byte code generated by a 64-bit JDK. If you have a problem which only occurs on a 64-bit JVM, is because there is a bug in the JVM and using a 64-bit JDK wouldn't make any difference.


The idea behind Java is that the byte code version of a program is the same for all platforms. This is why you can compile on a Windows machine and run the resulting class and jar files on a Linux box. I do such cross compilation daily.

This includes whether the JVM uses 32 or 64 bits.

So, the simple answer is no, there is no issues

(the more advanced answer is that if you also use non-Java native code that you bring in with your Java code, like a DLL or so, then that code will most likely need to be recompiled)


It depends on your application, but under normal circumstances, there whould be no problem running code from an x86 machine on an x64 machine, and vice versa.

If you use plain old java (no interop, no call to native libraries), the generated bytecode will be machine-independant, and should run on any installed JVM.


None that I can think of unless you explicitly called 32 bit native code specific to an environment.

Operating systems like windows use WoW64 to allow 32 bit apps to run under 64 bit systems. It is a provision that allows for backward compatibility. As long as native libraries depend only on 32 bit or only on 64 bit libraries, everything is good. The JVM takes care of converting your byte code to the appropriate machine code using JIT so there should be no worries.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜