The 46 and 45 are magic numbers that the java compiler puts into byte-code. It looks like you are trying to compile with a older (and incompatible) version of javac than the servlet classes were compiled against.

I've seen this before when an installation of Oracle added jdk1.1.8 when I was already using version 1.3...

What does java -version give?

Paul R Gazis wrote:

I'm running the J2SE 1.4.1_04 SDK and Tomcat 4.1.27 under Windows 2000.
The Tomcat installation runs fine, but try as I might, I cannot compile code
that imports any of the servlet classes. Attempts to do so yield that
damnable error message:


Invalid class file format in {my tomcat directory}\common\lib\servlet.jar
(javax/servlet/http/HttpServlet.class) wrong version:46, expected 45

Looking through the archives, I can see that this has been an enduring and
popular problem for much of the past year, but I can not locate any references
to the fix. I've tried all the obvious things: different versions of J2SE and
Tomcat, different settings for CLASSPATH, PATH, and other environment
variables, etc. Currently my enviroment variables are set to:


JAVA_HOME -- points to J2SE 1.4.1_04 SDK
CLASSPATH={my tomcat directory}\common\lib\servlet.jar
PATH -- points to {my JAVA_HOME}\bin

Any suggestions?  Surely this is a common problem, for which the solution
is well known.  I would welcome any help.  Thanks!

Paul Gazis
[EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to