I am using Java 1.7
in my code, now i want to replace JAVA 1.7
to JAVA 1.8
.Is Java 1.8
compatible to Java 1.7
. ?
Will it work as it before. i mean, all new features of Java 1.8 can be used in the existing piece of code?
In general, no. The backwards compatibility means that you can run Java 7 program on Java 8 runtime, not the other way around. There are several reasons for that: Bytecode is versioned and JVM checks if it supports the version it finds in .
You can install any number of JDK instances on your computer (and use them in projects or tools), but only one can be used as the main with JAVA_HOME env variable and its bin dir should be added to the PATH value like %JAVA_HOME%\bin .
As the Oracle Java SE Support Roadmap explains, Java SE 7 is planned to exit Extended Support and enter Sustaining Support in July 2022, after 11 years of fixes, security and other critical updates.
The end of public updates for Java 8 is scheduled for January of 2019 for commercial use. For non-commercial use, the same is scheduled at an unspecified date in December of 2020.
The existing piece of code will (ipso facto) not be using any new features of Java 8. If you have a piece of code which works1 on Java version v, it will also work on all other versions v' > v. That is the long-standing promise of the Java platform.
1 By "works" I mean "works as specified, using non-deprecated official JDK APIs".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With