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?
I know you can install both. Java 8 and Java 11 and keep them at the same time...
How do you minimize incompatibilities between releases?
The report is generated by the japi-compliance-checker tool.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With