Reputation: 3
I have a program using JDK 1.7 running on Windows Server 2008 (32 bits). If I want to re-deploy the program to the latest Windows Server (64 bits), do I need to rewrite the program or just minor change is ok?
Thanks a lot!
Upvotes: 0
Views: 1990
Reputation: 15094
Short answer
No, you should not need to change your code. You don't even need to recompile it. Just run your JAR/class and it should work fine.
You didn't provide much details of your application, so I ask you to read the long answer for more info, since there are considerations which might help you in the future.
Long answer
The Java Compiler generates bytecodes which are later interpreted by the JVM. The JVM translate the bytecode into native commands. The JVM will do the "hard work" while you can focus on one single program. The Java platform is platform independent, therefore you should not need to change your code if you are going from 32 bits to 64 bits Windows.
As always, there are some exceptions, which go beyond the 32/64 bits case. I will list some for example:
As a general practice, if you are going to cross platform your application, try to find the "boundaries" of your program. When do you have go "outside" your application to seek specific OS resources?
Even if your program runs in an application server, such as JBoss, you should not need to change your code.
I think your program will work fine without any changes, just keep in mind that exceptions may apply.
Upvotes: 1
Reputation: 1173
I don't think you need to change anything. Do you use any native code through jni?
First, are you using JDK or JRE on the 32 bit Windows? You just need JRE to run your application.
Second, on Windows 8, you can still install 32 bit JRE so your application should run.
Third, if you installed 64 bit JRE, your application should still run. There might be more bugs in 64 bit JRE. If you encounter a lot of bugs, just use 32 bit JRE instead.
Upvotes: 0