Take the 2-minute tour ×

I have read that "JDKs are usually forward-compatible, and JREs are usually backward-compatible."

What kind of version checking do Java developers do in their applications?

Do you upgrade your JDK with every release?

How do you minimize incompatibilities between releases?

share|improve this question
I voted to close, but clicked the wrong option. I wanted to vote to push this to Programmers.SE –  Jeremy Heiler Mar 4 '11 at 1:16

2 Answers 2

up vote 2 down vote accepted

The strategy that's worked well for us is to decide up front which versions of the JRE we'll support. We do this by considering the platforms in use by our users, the version-specific features of a particular JRE that we'd like to use, and the release dates of the JRE versions. All of this is done in close consultation with our customer support department. (Of course all else being equal we prefer newer releases, as they tend to have bug fixes, optimizations, security updates, etc.)

Then, this becomes input into our QA process. Our testing effort must encompass all of the versions of the JRE that we're supporting.

Finally, we use the ability to specify specific JRE versions in the JNLP file when we deploy our application, to ensure that customers who try to run our app with an unsupported version get a "fail-fast" experience (with a helpful message about how to get the right JRE version), rather than mysterious failures down the road.

One thing we do to minimize incompatibilities is to avoid undocumented APIs (sun.misc, etc.).

Explicitly checking the current version of the JRE from within your code should be considered only as last resort to work around a known bug in a particular JRE version. If such a bug is discovered early enough in the process, we much prefer to just remove that JRE version from the list of supported versions.

share|improve this answer

How do you minimize incompatibilities between releases?

share|improve this answer

Your Answer


