Which one of the two, runtime version and compile time version of a java program or a jar, should be greater or equal to the other? Edit : Also what should be the version of JRE System Library?
So both scenarios are quite possible: code compiled with older jdk running on newer runtime, and code compiled with newer jdk running on old runtime.
You should ideally always be running a Java program using a runtime environment which is the same or newer than what was used to build it. This is because Java generally ensures backwards compatibility to some extent. However, forwards compatibility is not guaranteed.
For example, if you built a Java program using version 1.7, it would be expected to run in a 1.8 JRE. But the reverse is not true, namely that a 1.8 program might not run correctly in an older 1.7 JRE.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.