JDK6 Libraries - JDK7 Compatible

Is JDK7 backward compatible with JDK 6? In particular, if I have several jars compiled using JDK6, can I use them when developing in JDK7?

+4
source share
3 answers

Is JDK7 backward compatible with JDK 6?

  • Read the white paper on incompatibilities between JDK 6 and 7
  • See this table for an independent analysis of API changes. Backward and binary compatibility of Jre classes between versions 6 and 7 is estimated at 95%:

enter image description here

...

enter image description here

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

+3
source

You can use class files from previous JRE / JDKs. Supported forward compatibility. However, you cannot go back (for example, JDK7 to an earlier JRE / JDK). The class file format for JDK7 has changed to reflect things like invokedynamic .

More details are discussed here .

+1
source

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

0
source

Source: https://habr.com/ru/post/1382564/


All Articles