Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java 1.8 versus java 1.7 Compatibility Issue

Tags:

java

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?

like image 872
Tarun Chaudhary Avatar asked Jan 28 '14 09:01

Tarun Chaudhary


People also ask

Is Java 1.8 backwards compatible?

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 .

Can Java 7 and 8 be coexist?

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 .

Is Java 1.7 still supported?

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.

Is Java 1.8 deprecated?

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.


1 Answers

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".

like image 90
Marko Topolnik Avatar answered Nov 04 '22 01:11

Marko Topolnik