Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Between Runtime and compile time jdk version , which one can be greater

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?

like image 714
Harshita Sethi Avatar asked Oct 15 '25 06:10

Harshita Sethi


1 Answers

  • So, my understanding is that you are compiling a java application with jdk1.6 and running the same application on a runtime which is based on jdk1.8. (for example, it could jdk1.7 too here)
  • Generally, JDK/JRE would be designed in such a way that it is backwards-compatible.
  • It would be better to use a runtime environment version (JVM) that is greater than or equal to the compile version and not vice-versa.
  • JDK(Compile-Version) <= JDK(Runtime-Version) - Correct
  • JDK (Compile-Version) >= JDK(Runtime -Version) - Incorrect
like image 126
a3.14_Infinity Avatar answered Oct 17 '25 19:10

a3.14_Infinity



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!