aspose file tools*
The moose likes Servlets and the fly likes UnsupportedClassVersionError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "UnsupportedClassVersionError" Watch "UnsupportedClassVersionError" New topic
Author

UnsupportedClassVersionError

Supriya Gupta
Greenhorn

Joined: Jul 06, 2008
Posts: 9
My Servlets are running successfully in Tomcat5. But when I tried to run the same in WebLogic8.1 I got the error message "Error 500-Internal Server Error"
java.lang.UnsupportedClassVersionError: CustomerSubmit (Unsupported major.minor version 49.0).
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:794)
........etc

Is it for version missmatch of my jdk and web server. I am not using any IDE. My JDK is jdk1.5.0_08 and WebLogic is 8.1


Regards
Supriya Gupta
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

It looks like the runtime VM is using the Java 1.4, while the code was compiled in Java 5. The simple solution is to either run WL using Java 5, or compile the code against Java 1.4
Supriya Gupta
Greenhorn

Joined: Jul 06, 2008
Posts: 9
Sir,
Please tell me how to run WL using Java5? Or how to compile using jdk 1.4? I have jdk1.4 also.

Regards

Supriya Gupta
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Not sure. First you need to visit the WL documentation to see if it is approved for usage with Java 5. This would be my preference. Compiling involves rebuilding all of the class files using the Java 1.4 compiler rather than Java 5
Richard Bradford
Ranch Hand

Joined: Apr 20, 2004
Posts: 48
If you do not have the 1.4 compiler installed you can use the Java 5 compiler while setting the target to 1.4:

javac -target 1.4
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
javac -target 1.4

If you do that, you may also have to use the "-source 1.4" switch.


Ping & DNS - updated with new look and Ping home screen widget
Supriya Gupta
Greenhorn

Joined: Jul 06, 2008
Posts: 9
I have both 5.0 and 1.4. For compiling with 1.4 I changed the classpath and path environment variable in system properties. Now my programs are running.

Thank you for your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UnsupportedClassVersionError
 
Similar Threads
relationship between abstract and inheriance class
Stateful Bean Naming Exception
Major Minor Version
Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file
NoSuchMethodError while accessing Entity bean via a Struts Action