4

Is JDK7 backward compatible with JDK 6? Specifically, if I have some jars compiled using JDK6, will I able to use them while developing in JDK7?

linuxbuild
  • 15,843
  • 6
  • 60
  • 87
John Smith
  • 511
  • 1
  • 7
  • 14

3 Answers3

3

Is JDK7 backward compatible with JDK 6?

  • Read official document about incompatibilities between JDK 6 and 7
  • Look at this table for independent analysis of API changes. The backward binary and source compatibility of Jre classes between 6 and 7 versions is estimated at 95%:

enter image description here

...

enter image description here

The report is generated by the japi-compliance-checker tool.

linuxbuild
  • 15,843
  • 6
  • 60
  • 87
1

You'll be able to use class files from previous JREs/JDKs. Compatibility forwards is supported. However you won't be able to go backwards (e.g. JDK7 to an earlier JRE/JDK). The class file format for JDK7 has changed to reflect such things as invokedynamic.

Some more in-depth information discussed here.

Community
  • 1
  • 1
Brian Agnew
  • 268,207
  • 37
  • 334
  • 440
0

Yes, you can certainly use older .jar files and .class files in your current development with newer compilers :)

paulsm4
  • 114,292
  • 17
  • 138
  • 190