0

I have a question about an exception that I have when I try to run my project. This exception is "java.lang.UnsupportedClassVersionError: .../*.class : Unsupported major.minor version 51.0. I found on other posts that it was a problem with the version of the JDK. When I deploy with JBoss my project, it uses JDK 1.7. When I try to deploy with Tomcat on a Virtual Machine, it used 1.6. That was the problem. But now, I changed it and downloaded jdk 1.7 on my VM, and it still doesn't work.

When I run tomcat with startup.sh, I have this :

Using CATALINA_BASE : /home/persyst

Using CATALINA_HOME : /home/persyst

Using CATALINA_TMPDIR : /home/persyst/temp

Using JRE_HOME : /usr/lib/jvm/java-7-openjdk-i386

Using CLASSPATH : /home/persyst/bin/bootstrap.jar

Moreover, when I try to download a new jdk7, I use rpm -i jdk-7u79-linux-x64.rpmand it tells me : Sorry, command-not-found has crashed! Please file a bug report at : ...

How should I do to download and install a good jdk7 please ?

Erlaunis
  • 1,433
  • 6
  • 32
  • 50

1 Answers1

1

UnsupportedClassVersionError Unsupported major.minor version 51.0 means you're trying use JDK 1.6 or lower to run code compiled with JDK 1.7.

This means the JRE_HOME is not what Tomcat is using to find the JDK. Use JAVA_HOME instead and it should work.

cahen
  • 15,807
  • 13
  • 47
  • 78
  • Thanks it works ! But I have an other problem now. Do you know what should I have in the variable CLASSPATH please ? – Erlaunis Nov 30 '15 at 15:36
  • I don't think you need to change the classpath variable at all to start Tomcat, why do you want to do this? – cahen Nov 30 '15 at 15:46
  • Could you check my new post please ? http://stackoverflow.com/questions/34002336/what-should-i-have-in-the-environnment-variable-classpath – Erlaunis Nov 30 '15 at 15:47