Tomcat: ... wrong version 49.0, should be 48.0 - done everything
Hi everybody,
I already read all kinds of threads about this topic, but I still get from Tomcat the error posted below (basically: "class file has wrong version 49.0, should be 48.0").
I did everything someone ever posted to solve the problem, namely the following:
- My PATH variable, as well as JAVA_HOME, CATALINA_HOME, and TOMCAT_HOME are all set properly (Java 1.5.0_08 path, Tomcat path)
- In Eclipse I did all necessary adjustments:
-> Ant->Runtime is set on Java 1.5/lib/tools.jar
-> Java->Installed JREs is set on jdk1.5.0_08
-> Tomcat is on version 5.x (I use 5.5.17) and the path is set correctly
-> Tomcat->JVM Preferences is on jdk1.5.0_08
I made the following changes to the web.xml in the TOMCAT_HOME\conf\web.xml:
<init-param>
<param-name>compilerTargetVM</param-name>
<param-value>1.5</param-value>
</init-param>
<init-param>
<param-name>compilerSourceVM</param-name>
<param-value>1.5</param-value>
</init-param>
Yesterday I even deleted all Java 1.4 versions on my PC (its a company PC, today they installed themselves again). Still the same error message. What else could cause the problem, what else should I do?
I start the Tomcat server in Eclipse, and when I start the browser and go on the tomcat site (http://localhost:8082/) the error comes. If I look at "http://localhost:8082/manager/status", under JVM Version it is says: 1.5.0_08-b03. I compiled the .java files of my project with Java 1.5. So how can it be?
Pleas help me, I'm desperate by now!!!
Here the Tomcat error message:
--
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: -1 in the jsp file: null
Generated servlet error:
[javac] Compiling 1 source file
D:user\Eclipse\workspace\myApp\work\index_jsp.java:9: cannot access myPackage.Const
bad class file: D:user\Eclipse\workspace\myApp\myPackage\Const.class
class file has wrong version 49.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
import myPackage.Const;
^
1 error
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
Apache Tomcat/5.5.17
--

