Manage java version compatibility

I read "jdks are generally forward compatible, and jres are generally backward compatible"

What version checks do java developers do in their applications?

Do you upgrade the JDK every time you release it?

How to minimize incompatibility between versions?

Solution

The effective strategy for us is to determine in advance which versions of JRE we will support We do this by considering the platform users use, the specific JRE version we want to use, the specific features, and the release date of the JRE version All this is done in close consultation with our customer support department (of course, we prefer new versions when other conditions are the same, because they often have bug fixes, optimizations, security updates, etc.)

Then, this becomes the input of our QA process Our testing work must cover all JRE versions we support

Finally, we use the ability to specify a specific JRE version in the JNLP file when deploying the application to ensure that customers trying to run our application with an unsupported version get a "quick failure" experience (useful information on how to use) and get the correct JRE version), rather than a mysterious failure on the road

One thing we do to minimize incompatibility is to avoid using unrecorded APIs (sun. Misc, etc.)

Explicitly checking the current version of JRE from code should only be regarded as a last resort to solve known errors in a particular JRE version If such errors are found early in the process, we prefer to delete the JRE version from the list of supported versions

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>