简体   繁体   中英

Compiling and upgrading to JDK 1.7

My team has intentions to upgrade our application server to run using JDK 1.7 and continue to serve our web application which is compiled using JDK 1.5

Due to the age of our project, we can't guarantee the source code we had is the latest thus we would like to minimize file changes on the server.

I would like to know if there any benefits to re-compile our web application using JDK 1.7 and deploy to the application server?

There is no beneift to re-compiling your code, other than to detect incompatible API changes (there should be very, very few) eg if you have implemented your own JDBC driver, it won't compile without some work.

All the interesting work is done by the JIT at runtime. The javac compile just sanity checks the code and translates as simply as it can.

As Peter Lawrey says, there is probably no immediate tangible benefit in recompiling using JDK 1.7.

However, I think that there is a long term benefit. Assuming that the update of your application server is intended to be permanent, then moving to a JDK 1.7 build platform means that you can start using Java 7 features in your webapp code-base. Furthermore, this gives you more flexibility in your choice of (versions of) 3rd-party dependencies.

But by all means, do it in stages; eg use the JDK 1.5 JAR / WARs to start with, and then try to rebuild.

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