user824212
user824212

Reputation: 1377

problem running tomcat 7.0.16 on mac 10.5.8

I'm trying to run tomcat 7 on my mac and when I try to start tomcat it just exits after printing the value of env variables it is using. So I ran configtest.sh which gave me the following error msg:

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file

After doing some search I found that this error occurs when tomcat is using jdk < 1.6 so I looked at the JRE_HOME that tomcat is using when it tries to startup which is

Using JRE_HOME: /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home

which in turn is a symlink to /System/Library/Frameworks/JavaVM.framework/Versions/1.5 and not to 1.6. I used the "Java Preferences" to use Java SE 6 but still it is not working.

I can manually update the ../CurrentJDK/Home to 1.6 but I was wondering how did tomcat pick up JRE_HOME as /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home and is there a setting that I need to update to use Java 1.6 instead on 1.5.

Thanks

Upvotes: 1

Views: 2003

Answers (2)

jaambros
jaambros

Reputation: 193

I had the same problem. The solution I found after reading the RUNNING.txt file at the top of the distribution is to set an environment variable in my ~/.bashrc

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

Upvotes: 4

andyb
andyb

Reputation: 43823

Apple's Java FAQ should answer everything you need.

In short, yes, you can change the system JDK via the Java Preferences, in the System Preferences. Can also be found by typing "Java" into Spotlight.

Upvotes: 1

Related Questions