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,508
  • 6
  • 57
  • 86
John Smith
  • 501
  • 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,508
  • 6
  • 57
  • 86
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
  • 261,477
  • 36
  • 323
  • 432
0

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

paulsm4
  • 107,438
  • 16
  • 129
  • 179