Unsupported major.minor version 52.0 Error

3.5k views Asked by At

I have codes compiled on JDK 1.8. I created war file and deployed it on Tomcat8 in an Ubuntu server running JRE 1.8. I have this error when opening the main page:

java.lang.UnsupportedClassVersionError: com/dash/io/web/bind/HomeCtrl : Unsupported major.minor version 52.0

$ java -versionjava version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

$ javac -version
javac 1.8.0_45

$ echo $JRE_HOME
/usr/local/java/jdk1.8.0_45/jre

$ /usr/local/apache-tomcat-8.0.22/bin/catalina.sh version 
Using CATALINA_BASE:   /usr/local/apache-tomcat-8.0.22 
Using CATALINA_HOME:  /usr/local/apache-tomcat-8.0.22 
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.0.22/temp 
Using JRE_HOME:        /usr/local/java/jdk1.8.0_45/jre 
Using CLASSPATH:       /usr/local/apache-tomcat-8.0.22/bin/bootstrap.jar:/usr/local/apache-tomcat-8.0.22/bin/tomcat-juli.jar 
Server version: Apache Tomcat/8.0.22 
Server built:   Apr 29 2015 11:46:15 UTC 
Server number:  8.0.22.0 
OS Name:        Linux 
OS Version:     3.13.0-52-generic 
Architecture:   amd64 
JVM Version:   1.8.0_45-b14 
JVM Vendor:     Oracle Corporation

Need help. Thanks.

1

There are 1 answers

1
Akah On

I'm guessing you are using maven to make your war and the maven-compiler-plugin. Have you well set your source and target version there ? The default configuration may not be what you want. http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html