Java is backward compatible, but why do we need to upgrade many libraries when we upgrade the JDK from 1.6 to 1.8?

Recently, I upgraded the JDK version from 1.6 to 1.8 in a java project However, there are some compilation or runtime errors, so I have to upgrade some libraries:

>Gradle: 1.9 to 1.10 > spring: 3 x to 4. x

That's because they use some earlier versions of ASM, but it only supports ASM from 5.0 JDK 1.8 for X

Java indicates that it is backward compatible, but why can't the original version of the library be used directly for JDK 1.8?

Solution

Because ASM is a tool that runs on Java bytecode And the bytecode format is changed to introduce new functions Therefore, you must upgrade the tool to support the new bytecode

Note that software compiled with older versions of JDK is not always applicable to newer versions of Java For example, in earlier versions of JDK, enumeration was not a keyword

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