I am deploying Spring application on Tomcat 8 server. The application uses Jena API from this maven repository. When I open the application in browser, it shows the following message (the same application can be opened without any problem when I do not use Jena API):
HTTP Status 500 - Handler processing failed; nested exception is java.lang.UnsupportedClassVersionError: org/apache/jena/query/QueryExecutionFactory : Unsupported major.minor version 52.0 (unable to load class org.apache.jena.query.QueryExecutionFactory)
I tried to solve this problem by changing the version of Java for Tomcat 8. I opened sudo nano /etc/init/tomcat.conf
and changed JAVA_HOME:
env JAVA_HOME=/usr/lib/jvm/java-8-oracle/jre
Then I restarted Tomcat 8 server and redeployed my application, but the same problem still exists. In fact I noticed that for some reason JRE 7 appears in the log message when starting the server:
May 07, 2016 5:26:11 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Java Home: /usr/lib/jvm/java-7-oracle/jre May 07, 2016 5:26:11 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Version: 1.7.0_80-b15 May 07, 2016 5:26:11 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Vendor: Oracle Corporation
I am not sure if this might be a possible reason of why the problem is not fixed. Any solution is highly appreciated.
P.S. I know that java.lang.UnsupportedClassVersionError
happens because of a higher JDK during compile time and lower JDK during runtime. So, do I understand correctly that Jena API was compiled with lower JDK?