Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java Backward Compatibility

Artful DodgerApr 23 2022 — edited Apr 23 2022

I am in a bind with respect to compatibility of different java versions, so I will start with the following:
My understanding has been that the JRE will run java compiled with the 'current' java compiler, or any java compiled by an earlier java compiler, i.e. the JRE is backward compatible with class files from former versions of the compiler.
I set about looking in books and on the internet to verify my thought. My java books are quite old and I could not find a statement to confirm this. On the internet, I have found some documentation:

    [https://docs.oracle.com/javase/tutorial/collections/interoperability/compatibility.html](https://docs.oracle.com/javase/tutorial/collections/interoperability/compatibility.html)  
    [https://stackoverflow.com/questions/4692626/is-jdk-upward-or-backward-compatible](https://stackoverflow.com/questions/4692626/is-jdk-upward-or-backward-compatible)  
    [https://stackoverflow.com/questions/54439762/java-jdk-11-breaking-old-jars-programs](https://stackoverflow.com/questions/54439762/java-jdk-11-breaking-old-jars-programs)  

Am I correct then, that with some exceptions, java JREs are backward compatible with class files compiled in former releases?
I will likely have follow up questions, but I'd like to this issue settle in my mind first.
Jim A.

Comments

Post Details

Added on Apr 23 2022
0 comments
1,392 views