ID #1056

Tomcat cannot start up: java.lang.UnsupportedClassVersionError: Bad version number in .class file

This error is likely to happen when your version of JDK is lower than required by Tomcat. On Mac computers, even if you have chosen Java 6 for Tomcat 7 via the utility Application/Java Preference, the one used by Tomcat is JAVA_HOME (which may not be Java 6, even if you specified previously, check its value by "echo $JAVA_HOME").

To solve this problem, modify Tomcat/bin/, add the following after the line "" to use Java 6 (change 1.6 to other versions required). Or, you can simply add this line in the Shell.

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home

Tags: installation, MacOS, tomcat, UnsupportedClassVersionError

Related entries:

You can comment this FAQ