In your own Java code, you do not need to do anything special regarding 32-bit or 64-bit. Unlike C and C ++, int in Java is always 32 bits, and long always 64 bits (in C and C ++ the size of these types depends on the system).
There are no separate 32-bit and 64-bit versions of Java bytecode; the bytecode is exactly the same, regardless of whether the JVM on which you can run it is 32-bit or 64-bit. You do not need to compile your Java source differently for 32-bit or 64-bit. As far as functionality is concerned, it doesnβt matter for your Java application if it runs on a 32-bit or 64-bit JVM.
There may be some technical differences already mentioned in jowierun. There may also be differences in performance; for example, the Oracle 64-bit JVM for Windows is configured differently from the 32-bit JVM, it does other JIT optimizations. I myself noticed this with an intensive computing application that I wrote recently; it runs much faster on a 64-bit JVM than on a 32-bit JVM. (But this is just one example, do not consider this as proof that any program runs much faster on a 64-bit JVM).
Jesper
source share