-2

我想在jdk1.6上运行一个jdk1.4编译的jar。会不会有什么不妥。JVM是前向兼容的,所以我认为不会有问题。是不是真的。

4

1 回答 1

0

As of the Java byte code, the compiled code should be backward compatible with increasing JRE versions. This means that in general, a v6 JVM should be able to run code that is compiled with a v4 JDK. (While the JRE is backward compatible, the Java compiler is forward compatible, i.e. v4 source code is supposed to be compilable by a v6 compiler.)

However, you can run into problems with the libraries that the v4 code is compiled against when the code is run on a v6 JRE. You can find an overview of API changes from v4 to v6 on this webpage.

于 2014-03-05T10:39:47.897 回答