On 24-Jun-2009, at 14:54, Ken Bowen wrote:

Hi all,

I failed at searching for this, even though I know it's been answered:
Setting:  Tomcat 6.0_20; Mac OS X 10.5.7;
I've been normally running against java 1.5.0_19, but I tried to install a war which is throwing

        .UnsupportedClassVersionError: Bad version number in .class file

when it tries to load. So clearly I need to run it under java 1.6, which is installed, and I know that moving to 1.6 is a good thing. However, for a while I'm going to need to switch back and forth between 1.5 and 1.6, because at least one customer is stuck at 1.5 for the present. I made a copy of tomcat's bin/startup.sh, renamed it sup16.sh, and added these two lines at the top:

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

This appears to work well enough -- the new war starts and does it's basic thing ok, and when I want to switch up to 1.6 in general, I could do the same thing creating a sup15.sh. So I really only have two questions:

1) Are there hidden problems lurking with doing things this way?

2) Is there a better way of being able to switch back & forth?

If this is simply for development purposes, then I would recommend having two installations of Tomcat. One is configured to use JDK 1.5 and the other JDK 1.6. Specify the JAVA_HOME in catalina.sh. There are other solutions, but from experience this is the simplest approach.

Andre

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to