Reputation: 21
I am trying to make a JDBC call to a SAP HANA database. My Java code version is Java 11. I am using ngdbc 2.11.14 HANA jdbc driver. I am getting below error.
Unexpected Java class loaded under Java version 11 (maximum supported version is 8): java.lang.AssertionError
java.lang.AssertionError: Unexpected Java class loaded under Java version 11 (maximum supported version is 8)
at com.sap.db.jdbc.DriverSapDB._checkJavaVersion(DriverSapDB.java:2179)
at com.sap.db.jdbc.DriverSapDB.checkJavaVersionMaximum8(DriverSapDB.java:2154)
Also I can see in decompiler, below code in Driver.java file, which checks for maximum Java version 8. Does this mean SAP HANA JDBC driver does not support Java 11?
public class Driver extends DriverSapDB {
static {
checkJavaVersionMaximum8();
}
Upvotes: 2
Views: 1305
Reputation: 1183
The SAP HANA JDBC driver is a multi-release JAR. From my basic understanding, this means that it carries separate class files for Java <= 8 and for Java > 8.
Short answer to your question: Yes, the SAP HANA JDBC driver does support Java 11 (and above)!
It seems your code (or framework) fetches the incorrect class files for Java 8 internally. I've had an issue in the past which resulted in the same error message that you see. For me, this has happened in the context of using OSGi and due to a bug with multi-release JARs in Apache Felix.
You can read the details about my issue (..which may or may not be different from yours) in this thread.
Upvotes: 2