tech20nn
tech20nn

Reputation: 729

jvm minor version vs compiler minor version

Will JVM throw exception when it runs classes compiled with a JDK that has same major version but higher minor version compared to JVM ?

Upvotes: 2

Views: 585

Answers (2)

Michael Borgwardt
Michael Borgwardt

Reputation: 346260

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.

Upvotes: 3

M. Jessup
M. Jessup

Reputation: 8222

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.

Upvotes: 2

Related Questions