Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member193577
Active Contributor

With the release of 7.50, EP now runs with SAP JVM 8, which is JDK 8 compliant Java VM, to keep up with the speed of innovation and enable customers to benefit from new Java features.


Here is some info that may assist you you understand the differences and issues you may encounter migrating from older java versions.


 

  • Java 8 provides some new cool features like Lambdas and Concurrency, new Date Time API, Nashorm Javascript , Interface Default , Method reference and more.

  • :smile: You may now use this in your portal application running in EP 7.50 !

  • :sad: However , it also have some pitfalls. Some of them are incompatibilities with older java versions.


 

ℹ All SAP applications provided with EP 7.50 are compatible with Java 8.


You may want to inspect and fix any custom application that you have to make it Java 8 compliant.


 


Sample issues that you may encounter in your java code related to Java version:


 


1. Dependencies changes:


With Java 8, when using a class, the interfaces it implements must be on the compile classpath as well. With Java 7, it was enough that the interface was on the classpath while compiling the used class.


Given a jar api.jar containing an interface, and a jar api-impl.jar containing an implementation of the interface. While compiling source code that is dependent on the concrete implementation, you obviously need api-impl.jar on the classpath. With Java 8, additionally, you need to have api.jar on the classpath, even when you do not reference the API.

2. Deprecated and removed APIs:


assert / assertTrue deprecation:



    response.assert(ok," : default value is not null","1002001"); --> deprecated and will not compile with java 8
response.assertTrue(ok," : default value is not null","1002001"); --> will compile correctly.

PreparedStatement interface has new methods, so if you have class implementing it, you should add new methods:



class PlStmt implements PreparedStatement
{..
.
public void closeOnCompletion() throws SQLException{....}
public boolean isCloseOnCompletion() throws SQLException{....}
public long executeLargeUpdate() throws SQLException{...}
public void setObject(int parameterIndex, Object x, SQLType targetSqlType,int scaleOrLength) throws SQLException{...}
public void setObject(int parameterIndex, Object x, SQLType targetSqlType) throws SQLException{....}
...
}

You can use the following link for learning the exact incompatibilities of Java 8 with previous versions:

The suggestion is first try to build your applications with SAP JVM8 and fix any build issues, afterwards try to deploy and execute it.

 

Further reading for your reference:

 

 

ℹ Still have questions? Post them in the migration and upgrade forum.

 

You want to influence the future product roadmap of Enterprise Portal? You plan to implement your portal in the Cloud? Then you should participate in the following survey https://blogs.sap.com/2016/10/11/2016-elections-vote-now/.

 

Thanks!

Tal


4 Comments