Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unsupported major.minor version 50.0

 
adjeiinfo
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm Kelson new to this forum

I will ask almost the same things in this topic
I got the "Unsopported major.minor version 50.0" error

java -version >>
java sersion "1.6.0=07"
java(tm) se runtime environment (build 1.6.0_07-b06)
java hotspot(tm) server vm (build 10.0-b23,mixed mode)
javac -version>>
javac 1.6.0_07
I'm trying to run a simple servlet and I got this error message on my browser.
I'll will really be happy if someone can help me solve this problem
thank


type

message

The server encountered an internal error () that prevented it from fulfilling this request.



javax.servlet.ServletException:
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Thread.java:534)



java.lang.UnsupportedClassVersionError: HelloWorld (Unsupported major.minor version 50.0)
java.lang.ClassLoader.defineClass0(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:539)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
java.net.URLClassLoader.access$100(URLClassLoader.java:55)
java.net.URLClassLoader$1.run(URLClassLoader.java:194)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:187)
java.lang.ClassLoader.loadClass(ClassLoader.java:289)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
java.lang.ClassLoader.loadClass(ClassLoader.java:235)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1301)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Thread.java:534)
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error means that your copy of Tomcat is not running on the 1.6 JVM; you've got some older version of Java installed as well, and Tomcat is running on this older JVM.

Windows systems often have an extra java.exe in C:\WINDOWS or some other similarly odd place which causes this kind of problem.
 
adjeiinfo
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for you reply

you've got some older version of Java installed as well, and Tomcat is running on this older JVM.

I'm using suse 10.3
Please could you tell me how to remove this older version of java and how
to make tomcat running on my new jvm?
 
Campbell Ritchie
Sheriff
Posts: 48406
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have a Java installation folder you can log in as "su" and delete it. You will of course have to install a new Java installation; if it is in /usr/java you will have to add the PATH by adding this sort of line to ~/.bashrc or something similar.

export PATH=/usr/java/jdk1.6.0_10/bin/:$PATH

You can use the same line when you open a shell, so setting the PATH for the lifetime of that shell.
 
adjeiinfo
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank a lot for your help.

After checking I realized that there were was an old version of java.
I reinstalled everything but I got a different error. Your aid will be
welcome. Thank you

javax.servlet.ServletException:
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Thread.java:619)

クカー・
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:621)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
java.net.URLClassLoader.access$000(URLClassLoader.java:56)
java.net.URLClassLoader$1.run(URLClassLoader.java:195)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
java.lang.ClassLoader.loadClass(ClassLoader.java:307)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
java.lang.ClassLoader.loadClass(ClassLoader.java:252)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1301)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Thread.java:619)

クカー・
java.lang.ClassNotFoundException: javax.servlet.http.HttpServlet
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
java.lang.ClassLoader.loadClass(ClassLoader.java:307)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
java.lang.ClassLoader.loadClass(ClassLoader.java:252)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:621)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
java.net.URLClassLoader.access$000(URLClassLoader.java:56)
java.net.URLClassLoader$1.run(URLClassLoader.java:195)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
java.lang.ClassLoader.loadClass(ClassLoader.java:307)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
java.lang.ClassLoader.loadClass(ClassLoader.java:252)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1301)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Thread.java:619)
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It can't find a jar file on your CLASSPATH that contains the HttpServlet class. This is usually a jar file called something like j2ee.jar, but I'd also check the Tomcat documentation.....
 
adjeiinfo
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At last I worked fine!!

The classpath problem was caused by my catalina.sh setting
It seems that the tomcat starts using JRE_HOME.
so I change this line
echo "using JRE_HOME: $JRE_HOME" into
echo "using JAVA_HOME: $JAVA_HOME"

after recompiling i got my program worked fine

could someone tell me why this make it work?
[ November 28, 2008: Message edited by: adjeiinfo Kelson ]
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JRE_HOME and JAVA_HOME are two different variables that can each have different values.

Typically (but not always) the JRE_HOME is set to where your _public_ JRE is installed, something like C:\Program Files\Java\....

Typically (but not always) the JAVA_HOME is set to where your JDK is installed, C:\jdk1.5.0_16\

The JDK installation also has a private JRE, e.g. C:\jdk1.5.0_16\jre

I hope that poor example helps a little
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic