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

UnsupportedClassVersionError when attempting to run a precompiled tool

 
H Melua
Ranch Hand
Posts: 172
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Java ranch!

I was given a tool to run that I need for my work, and I simply don't know how to fix these errors!
(I can post the tool if anyone wants to see it, its freely accessible by the author)

Now my problem is that it throws this exception
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/chatley/magicbeans/PluginManager (Unsupported major.minor version 49.0)

The files are already compiled! and as far as I'm aware from the author is that it works fine! I was told to run it using an old version of java, and that's what I'm doing... running it on j2re1.4.1_07
The files supposed to be compiled by the same Java version that I'm using to run it.
Question: how do I check the compiler version that was used to compile the classes?

I understand the problem as follows: I'm attempting to run the tool using an old version of JDK when the files have been compiled by a new compiler version. But this shouldn't apply because the author was running his files without a problem!

This is the command line I'm using (given to me by the author in the same file)...
C:\j2re1.4.1_07\bin\java -cp .;lib\framework.jar;lib\custom.jar;lib\xml.jar;lib\scenebeans.jar;lib\jel.jar;lib\jdom.jar;lib\LTL2Buchi.jar;lib\jcommon-0.6.1.jar;lib\jfreechart-0.8.1.jar com.chatley.magicbeans.PluginManager lib\framework.jar lib\ltsa.jar ic.doc.ltsa.HPWindow

The file that is causing the problem is in "lib\framework.jar"...

What would you advise me to do? Recompile the package again on the same compiler version as 1.4.1?

Thank you
HannaH
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Class file version 49 is JDK 1.5 (aka Java 5), so your "old JDK" is a little too old!
 
H Melua
Ranch Hand
Posts: 172
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ernest Friedman-Hill wrote:Class file version 49 is JDK 1.5 (aka Java 5), so your "old JDK" is a little too old!


Does that mean the framework.jar file has been compiled by a newer version than my 1.4 java.exe?
and should I to recompile the framework.jar again using 1.4?

Thanks
 
Steve Luke
Bartender
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
H Melua wrote:
Ernest Friedman-Hill wrote:Class file version 49 is JDK 1.5 (aka Java 5), so your "old JDK" is a little too old!


Does that mean the framework.jar file has been compiled by a newer version than my 1.4 java.exe?
and should I to recompile the framework.jar again using 1.4?

Thanks


Yes. Or, since Java 1.4 is at the end of its service life you might consider moving to a current JVM (1.5 or 6) if possible. You are likely to run into this same problem more often as time goes on.
 
H Melua
Ranch Hand
Posts: 172
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Steve, Ernest

Well the problem is that the tool doesn't work well with Java 5, it crashes and goes into a state-explosion problem

But thanks for your help, I'll try your advise and see what happens.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could always try retroweaving/retrotranslating the 1.5 jar down to 1.4.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic