This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"Bad version number in .class file"

 
Joe Goble
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've tried everything and I am getting absolutely no where. I'm building a dynamic web project, I need to build using Java 1.5 because I'm limited to Tomcat 5.5. I added this Jar to access a movie database: http://sourceforge.net/projects/jtmdb/. Building is fine, but when I load a page that imports the class I get a nasty 500 error. Here is my error from loading localhost:8080/tmdb-test/test.jsp


My Jave home environment variable is: C:\Program Files\Java\jdk1.5.0_22
My path variable for Java is set to: %JAVA_HOME%\bin;
My classpath environment variable is not set.
My project facet for Java is set to: 1.5
In Eclipse preferences -> Java -> Installed JRE's -> I have jdk1.5.0_22 checked
In Eclipse preferences -> Java -> Compiler -> I have Compiler compliance level set to 1.5

I think I know what the problem is. The Jar I added was built using 1.6, and it's complaining because I'm trying to run it using 1.5. I don't know how to get around this, though. Is there a way to check what version Jar's are made for? Is there a way to downgrade? Is this even the issue? I've tried importing different classes from the Jar into my JSP and I get similar errors. I'm also not sure if this is just a Tomcat issue. Thanks for the help!
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11831
181
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe Goble wrote:I need to build using Java 1.5 because I'm limited to Tomcat 5.5.

Joe Goble wrote:I think I know what the problem is. The Jar I added was built using 1.6, and it's complaining because I'm trying to run it using 1.5. I don't know how to get around this, though.

Run using Java 6? Tomcat 5 works quite happily on top of JDK 6.
 
Joe Goble
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My bad, my web host actually limits me to JDK 1.5.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you will need to build using JDK 1.5.

Your javac compiler may have a switch to compile in 1.5 mode, I don;t know for sure.
 
Joe Goble
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, thank you. Bear, I'm not sure if this is exactly what you meant, but it put me in the right direction. I downloaded the source to the Jar and just added the classes to my project. It's working great now.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47216
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you have done is re-compile with Java6, I suspect.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic