This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
When I try to startup tomcat 6.0.10 using 'startup' fron a Window platform, I am not able to. So when I tried using the 'catalina debug' startup option I get a UnsupportedClassVersionError. Since I was on JDK 1.6 I guessed it could be a compatibility issue between versions. I got JDK 1.5.0_11.
My issue is like I still get the same error. Checking the documentation I found that tomcat 6.0 works with JDK 1.5 Any ideas on how to resolve this?
It's been thrown in the ClassLoader. I also have my CATALINA_HOME and JAVA_HOME pointing to the correct folders.
This is the relevant stack trace part....
============================================================================ run org.apache.catalina.startup.Bootstrap start > VM Started: Exception occurred: java.lang.UnsupportedClassVersionError (uncaught) thread="ma in", java.lang.ClassLoader.defineClass(), line=732, bci=217
main cont java.lang.UnsupportedClassVersionError: org/apache/catalina/startup/Bootstrap (U nsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass(ClassLoader.java:732) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:13 3) at java.net.URLClassLoader.defineClass(URLClassLoader.java:320) at java.net.URLClassLoader.access$400(URLClassLoader.java:93) at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:678) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:239) at java.lang.ClassLoader.loadClass(ClassLoader.java:516) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:460) at java.lang.ClassLoader.loadClass(ClassLoader.java:448) > Exception in thread "main"
The application exited ============================================================================
Joined: Mar 22, 2005
Class version 49.0 is the one used by Java 5, so if the JVM complains about that, it must be 1.4 at the most. How are you starting Tomcat, and how do you determine which JRE it uses?
I downloaded JRE 1.4.2_14. Uninstalled JRE 1.5 and got the older version installed. Still I get the same error report. When I do a java -version this is what I get :- === java version "1.4.2_14" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_14-b05) Java HotSpot(TM) Client VM (build 1.4.2_14-b05, mixed mode) === Shouldn't it be running on the same (currently installed) JRE? Do you think I sould be looking for JRE 1.4.0 or something?
But I'm not trying to deploy any of my applications on Tomcat. All I'm doing is trying to startup the server and thats when I get this error. As far as tomcat installation is concerned I have a binary version downloaded. What I feel is maybe I'm leaving out something?
Could somebody help me on that?
Joined: Mar 22, 2005
Do you think I sould be looking for JRE 1.4.0 or something?
No. It was already running on a 1.4 JVM; that's why you got that error. A 1.5 or later JVM wouldn't have this problem.
It's not unheard of to have multiple JREs installed, sometimes without even being aware of it. Alter the startup script so that it definitely uses a 1.5 JRE to run, and see what happens.