I understand that the byte code generated by version JDK X is guaranteed to work on JVM Y, provided Y >= X.
Does this hold good for all versions of JDK/JVM? i.e Is it fair to expect class files generated by JDK 1 to work on JVM 11?
Referred to JVM specs, JDK 8 compatibility guide and Java 11 JSR Could not find a precise answer there.
The bytecode itself should work in future versions. Until now this holds true but nobody knows if this will be true for all future.
What changes, and can break your program, are changes in the API. Deprecated APIs may vanish in the future and then your program will not work anymore and may throw a java.lang.NoSuchMethodError
when referencing such a method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With