Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 116713

Summary: UnsupportedClassVersionError when using Tomcat 5.5 with default JRE set to 1.4.2
Product: [WebTools] WTP ServerTools Reporter: Kathy Chan <kathy>
Component: jst.serverAssignee: Tim deBoer <deboer>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: cbrealey, konstantin
Version: 1.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
See Also: https://git.eclipse.org/r/107578
Whiteboard:

Description Kathy Chan CLA 2005-11-16 14:53:43 EST
Driver:  I20051116_1051

If your default JRE is set to 1.4.2 and you have a Web project targetting 
Tomcat 5.5 (dynamic Web module version 2.4 and Java 5.0), when you tried to run 
a main program, you'll get the error:

java.lang.UnsupportedClassVersionError: echo/EchoMain (Unsupported major.minor 
version 49.0)
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
	at java.security.SecureClassLoader.defineClass
(SecureClassLoader.java:123)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
Exception in thread "main" 

If you switch the default JRE to 1.5, then the problem goes away.

This did not used to cause problem with the 1110_0034 I-build.

Please reassign if appropriate.
Comment 1 Konstantin Komissarchik CLA 2005-11-16 15:11:25 EST
Not sure why exactly the UnsupportedClassVersionError comes up, but there is 
definitely a disconnect between the vm version that the server is actually 
using and what's specified in the server runtime definition. Ideally, the 
runtime definition should sniff what vm tomcat is using and always use that. 
The user should not be able to select it.
Comment 2 Kathy Chan CLA 2005-11-18 14:27:23 EST
*** Bug 117073 has been marked as a duplicate of this bug. ***
Comment 3 Kathy Chan CLA 2005-11-18 14:30:55 EST
Raising the severity and requesting for for M9.

If the user launch Eclipse with JDK 1.4.2, even if in the workbench they switch 
the default JRE to 1.5, they would not be able to run a Web service bottom-up 
scenario in a Web project targetting Tomcat 5.5.  This used to work fine with 
builds a few days earlier.
Comment 4 Tim deBoer CLA 2005-11-21 15:54:01 EST
Fix dropped to HEAD.
Comment 5 Kathy Chan CLA 2005-11-21 16:28:38 EST
Opened defect 117372 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=117372) for the problem with Web services tool described in comment 3.
Comment 6 Tim deBoer CLA 2005-11-21 23:15:42 EST
Released for M9.
Comment 7 Kathy Chan CLA 2005-11-23 16:32:15 EST
Verified on 1122_2206 S-build.
Comment 8 Eclipse Genie CLA 2017-10-11 15:53:57 EDT
New Gerrit change created: https://git.eclipse.org/r/107578