开发者

jvm minor version vs compiler minor version

开发者 https://www.devze.com 2022-12-28 11:46 出处:网络
Will JVM throw exception when it runs classes compiled with a JDK that has same major version but higher minor version compa开发者_如何学JAVAred to JVM?The JDK version does not really matter, the clas

Will JVM throw exception when it runs classes compiled with a JDK that has same major version but higher minor version compa开发者_如何学JAVAred to JVM ?


The JDK version does not really matter, the class file format version does. So far, the minor version of the class file format hasn't been used, and changes in the major version have always corresponded with major JDK release (counting 1.2 -> 1.3 -> 1.4 as major releases).

Additionally, the -target option of javac can be used to produce class files compatible with older runtimes.


No, the JVM will only complain if you try to run code that has been compiled for a higher major version of the language. For example you can run code compiled with JDK1.4 on a 1.6 VM.

0

精彩评论

暂无评论...
验证码 换一张
取 消