You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by JavaNetIn <ja...@swissinfo.org> on 2004/04/06 04:54:13 UTC

Bad Class Version while compiling JSP Files on Tomcat

I have j2sdk1.4.2. Exact version information as follows.

java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)


On Tomcat 4.0-b7, Tomcat 5.0.7 & Tomcat 5.0.19 JSP pages couldn't
compile while servlets works fine. Iknow by shifting to jdk1.3.1 this
problem will solve. But I can not do that. Tomcat 5.0.19 is the latest
release build.

Is the same problem everywhere?

To get rid of this should I download whole source code & other huge
libraries & compile it for j2sdk1.4.2.

Or downloading jikes will solve problem?

Error :

J:\Java\Downloads\Tomcat\jakarta-tomcat-5.0.19\work\Catalina\localhost\OnlineExam\org\apache\jsp\AvailableContext_jsp.java:8: 

cannot access java.lang.Object
bad class file: D:\j2sdk1.4.2\jre\lib\rt.jar(java/lang/Object.class)
class file has wrong version 48.0, should be 47.0
Please remove or make sure it appears in the correct subdirectory of the
classpath.
     implements org.apache.jasper.runtime.JspSourceDependent {
                ^
1 error



./Nikhil






---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Bad Class Version while compiling JSP Files on Tomcat

Posted by David Smith <dn...@cornell.edu>.
Hi.

Sounds to me like your jar files are compiled under different JDKs.  Be 
sure when you install j2sdk1.4.2 to completely replace all files in the 
JDK directory.  I'd actually go so far as to clean install in a separate 
directory (ie /usr/java/j2sdk1.4.2_04) and then symlink j2sdk to it.  
Set JAVA_HOME to j2sdk and it'll find the jdk.  Also be sure all your 
webapp files are compiled under the 1.4.2 JDK.

--David

JavaNetIn wrote:

> I have j2sdk1.4.2. Exact version information as follows.
>
> java version "1.4.2"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
> Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
>
>
> On Tomcat 4.0-b7, Tomcat 5.0.7 & Tomcat 5.0.19 JSP pages couldn't
> compile while servlets works fine. Iknow by shifting to jdk1.3.1 this
> problem will solve. But I can not do that. Tomcat 5.0.19 is the latest
> release build.
>
> Is the same problem everywhere?
>
> To get rid of this should I download whole source code & other huge
> libraries & compile it for j2sdk1.4.2.
>
> Or downloading jikes will solve problem?
>
> Error :
>
> J:\Java\Downloads\Tomcat\jakarta-tomcat-5.0.19\work\Catalina\localhost\OnlineExam\org\apache\jsp\AvailableContext_jsp.java:8: 
>
> cannot access java.lang.Object
> bad class file: D:\j2sdk1.4.2\jre\lib\rt.jar(java/lang/Object.class)
> class file has wrong version 48.0, should be 47.0
> Please remove or make sure it appears in the correct subdirectory of the
> classpath.
>     implements org.apache.jasper.runtime.JspSourceDependent {
>                ^
> 1 error
>
>
>
> ./Nikhil
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org