简体   繁体   中英

Install JDK7 on linux

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.rpm and 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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM