wood burning stoves 2.0*
The moose likes Java in General and the fly likes UnsupportedClassVersionError when attempting to run a precompiled tool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "UnsupportedClassVersionError when attempting to run a precompiled tool" Watch "UnsupportedClassVersionError when attempting to run a precompiled tool" New topic
Author

UnsupportedClassVersionError when attempting to run a precompiled tool

H Melua
Ranch Hand

Joined: Jan 04, 2005
Posts: 172
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

Joined: Jul 08, 2003
Posts: 24183
    
  34

Class file version 49 is JDK 1.5 (aka Java 5), so your "old JDK" is a little too old!


[Jess in Action][AskingGoodQuestions]
H Melua
Ranch Hand

Joined: Jan 04, 2005
Posts: 172
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

Joined: Jan 28, 2003
Posts: 4174
    
  21

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.


Steve
H Melua
Ranch Hand

Joined: Jan 04, 2005
Posts: 172
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

Joined: Sep 29, 2008
Posts: 12617

You could always try retroweaving/retrotranslating the 1.5 jar down to 1.4.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: UnsupportedClassVersionError when attempting to run a precompiled tool