• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

UnsupportedClassVersion

 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just for completeness, there is still the Sun Archive.
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic