This week's book giveaway is in the Testing forum.
We're giving away four copies of Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples and have Jeremy Kubica on-line!
See this thread for details.
  • 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

UnsupportedClassVersionError when attempting to run a precompiled tool

 
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could always try retroweaving/retrotranslating the 1.5 jar down to 1.4.
 
That new kid is a freak. Show him this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic