简体   繁体   中英

Do you recompile your java code if you upgrade your application servers or JVMs?

Just wondering what others in the Java world usually do with recompiling their binaries when they upgrade their applications servers or JVMs? Is it really necessary? Thanks!

update: just want to clarify. The recompiling meant to recompile the code with JDK version same as the upgraded one on the servers. In other words, currently our code is compiled with JDK 1.5 and our server is JVM 1.5. If we upgrade our server to JVM 1.6, does it make sense to recompile the code with JDK 1.6?

"No" is the basic answer.

The application server or JVM onto which an application will be deployed cannot have a compile-time effect on the byte code. So, recompiling ought to generate exactly the same byte code. Therefore recompiling can't do anything useful.

Of course, if the Java or app server APIs that you use changed, you would have to not only recompile, but change your code first accordingly!

You don't have to.

But I would. With a change in the application server you usually exchange your development enviroment. Sometimes you upgrade some other tools as well. For making sure that I'm still able to make a changes I would recompile the project and check if my new development environment is working.

If you change your JVM its often a must. If you change from Linux to Windows or even from Systems like Solaris or AIX I would espacially make sure its working. If you switch from IBM JDK to Oracle I'd check everything as well, but its more a matter of testing than compiling.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM