Use the latest JRE instead of the old java version. Can I guarantee that it will work?

Suppose I have a java project encoded in Java 1.5. I use a newer version of Java, but set the target to 1.5

If the code is OK after compiling and testing in Java, can I guarantee that it will work the same in the actual Java 1.5 runtime?

Or do I need to install a version of the JRE I rely on?

What happens to errors in JRE? If there is a bug in 1.5, it is a bug in 1.6 If I use Java 1.6 and the target is set to 1.5, will that bug affect me?

In a realistic situation, is this a question I need to have?

resolvent

Solution

If you set your goal and goal to 1.5, you only need to worry about three main situations. I can think of:

>You are using internal com Sun class, which may have changed or disappeared (or rely on some other internal behavior). > You are relying on the off-road vehicle behavior fixed in the updated version. > You have encountered a backward incompatible change (rarely, but known to happen)

If the error is in the library, it will not affect you The goal is to really specify the version of bytecode you compile, and you will still use the updated library As mentioned earlier, please note that this can cause problems if you rely on this wrong behavior

If there is a deliberate backward incompatibility change, all the situations I see will compile themselves as compile time errors rather than run-time errors, so they will be insignificant (usually easy to fix)

Before release, I still advocate testing on a new version of JVM, but in fact, it is usually not a problem in my experience

The above is collected by programming house for you. Use the latest JRE instead of the old java version. Can I guarantee that it will work? I hope this article can help you solve the problem of using the latest JRE instead of the old java version. Can I guarantee that it will work? Program development problems encountered.

If you think the content of the programming home website is good, you are welcome to recommend the programming home website to programmers and friends.

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
分享
二维码
< <上一篇
下一篇>>