Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UnsupportedClassVersionError

 
Supriya Gupta
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javac -target 1.4

If you do that, you may also have to use the "-source 1.4" switch.
 
Supriya Gupta
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic