Forum Stats

  • 3,816,416 Users
  • 2,259,185 Discussions
  • 7,893,475 Comments

Discussions

Java Backward Compatibility

Artful Dodger
Artful Dodger Member Posts: 2 Green Ribbon

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://stackoverflow.com/questions/4692626/is-jdk-upward-or-backward-compatible

        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.