Re: That ever-popular 'wrong version:46, expected 45' message
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]
Re: That ever-popular 'wrong version:46, expected 45' message
John Corrigan wrote Haven't seen/heard anything about this error, but it looks to me like maybe you have an older version of servlet.jar in your ext directory That does not seem to be ther problem. There is only one servlet.jar, right where it should be in the Tomcat common lib Jon Wingfield wrote: 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... That's pretty much what I guessed myself, but I when I checked the java version number. I found H:\BrilliantlyImaginativeDirectoryName\java -version java version 1.4.1_04 java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_04-b01) Java HotSpot(TM) Client VM (build 1.4.1_04-b01, mixed mode) This is the version of Java the Installation Wizard alledged that it was using when I isnatlled Tomcat -- in fact, it is the only version of Java on this paritcular machine. Has anyone ever made a list of exactly which versions of the Tomcat serlet.jar are compatible with whichversions of Java? Is there even documentation that describes which versions of javac the mystical version numbers '46' and ' 45 refer to? Paul Gazis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: That ever-popular 'wrong version:46, expected 45' message
Howdy, in fact, it is the only version of Java on this paritcular machine. Has anyone ever made a list of exactly which versions of the Tomcat serlet.jar are compatible with whichversions of Java? Is there even documentation that describes which versions of javac the mystical version numbers '46' and ' 45 refer to? I think it's roughly: 46 - JDK 1.2.2 47 - JDK 1.3.0 48 - JDK 1.4.0 You can use BCEL (http://jakarta.apache.org/bcel/) to confirm/correct the above (I'm only about 50% sure of the above) if you'd like. This error comes up when you're trying to run classes compiled in a newer JVM than the one you're running. If you compile the classes yourself on this machine and there's only one JVM on this machine, I'm stumped ;) If neither of those is true, make sure your only JVM on this machine is the latest JVM possible. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: That ever-popular 'wrong version:46, expected 45' message
You have a old version of the tools.jar file. Get rid of it. Larry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: That ever-popular 'wrong version:46, expected 45' message
Larry Meadors writes: You have a old version of the tools.jar file. Get rid of it. I checked yesterday after looking through old message on this archive and I don't see how that can be the problem. I have precisely two copies of the tools.jar file, one in my j2sdk1.4.2, and one in my Tomcat4.1.27 directory. Each is 4.85 M, and contains 1373 (or whatever) entries. They are, as far as I can tell, new, current, and entirely identical. If they aren't -- if I have missed some subtle difference -- which one should be consigned to oblivion? Paul Gazis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: That ever-popular 'wrong version:46, expected 45' message
the one in tomcat [EMAIL PROTECTED] 08/20/03 2:07 PM Larry Meadors writes: You have a old version of the tools.jar file. Get rid of it. I checked yesterday after looking through old message on this archive and I don't see how that can be the problem. I have precisely two copies of the tools.jar file, one in my j2sdk1.4.2, and one in my Tomcat4.1.27 directory. Each is 4.85 M, and contains 1373 (or whatever) entries. They are, as far as I can tell, new, current, and entirely identical. If they aren't -- if I have missed some subtle difference -- which one should be consigned to oblivion? Paul Gazis - 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]
RE: That ever-popular 'wrong version:46, expected 45' message
Haven't seen/heard anything about this error, but it looks to me like maybe you have an older version of servlet.jar in your ext directory. Under windows, there are three different ext directories: one used when compiling, one when running, and one when using the jvm.dll. I would check to see if you have a servlet.jar file in any of those places (or just do a complete search of the file system.) FWIW, John -Original Message- From: Paul R Gazis [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 6:21 PM To: [EMAIL PROTECTED] Subject: That ever-popular 'wrong version:46, expected 45' message 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]