File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UnsupportedClassVersion

 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm getting one of these fool errors while running Cobertura through ANT. I think it means something in an older version of ANT is trying to load one of my classes in a newer version. Is that right? Maybe I need to figure out how to update ANT within WSAD?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This error means that you are trying to load a class with an older version of Java that was compiled with a newer version. If I remember correctly, the class version numbers for the last few Java releases are as follows:

Java 1.3: 47.0
Java 1.4: 48.0
Java 5.0: 49.0
Java 6.0: 50.0

Your specific error message means that you have a class file that is compiled on JDK 1.4, and you are trying to run it on Java 1.3 or older.

It is possible to compile class files that are compatible with older versions of Java by specifying the "-target" switch on the command line, but note that this does not solve the problem completely; if you use classes, interfaces or methods in the standard API that are new to Java 1.4, you will get a ClassNotFoundException or NoSuchMethodException during runtime.

The best solution is to compile your source code with the JDK version that matches the target Java runtime version.

JDK 1.3 is still available from the Sun website, but note it has gone EOL (End of Life) since December 2006, so it's time you upgrade to a newer version...

*edit*: Oh, I see that JDK 1.3 on that page is only for Solaris. I don't know if it's still available for other OS'es. But you are maybe using IBM's JDK instead of Sun's - have a look on IBM's website.
[ November 01, 2007: Message edited by: Jesper Young ]
 
bart zagers
Ranch Hand
Posts: 234
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just for completeness, there is still the Sun Archive.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, I did just go to the effort of making WSAD use 1.4 when I start things in the IDE. I wonder how to make it use 1.4 from ANT. Something to google tomorrow. Thanks for the tip!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic