Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UnsupportedClassVersionError

 
Sunny Gibbony
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting this error when I run my master.bat file. I've checked the jdk class path and it looks fine. Has anyone seen this before?


run specialties load .bat BEGIN...
Exception in thread "main" java.lang.UnsupportedClassVersionError: example/SpecialLoader (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
run specialties load .bat COMPLETED

run zone inspection load .bat BEGIN...
Exception in thread "main" java.lang.UnsupportedClassVersionError: example/InspectionLoader (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
run zone inspection load .bat COMPLETED

run all .bat files COMPLETED
Press 'Enter' to exit...
 
Norm Radder
Ranch Hand
Posts: 886
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like the class file was compiled with a younger version of java than you are using to execute it. Check that the java program is as young as the javac program used to compile it.
 
Vilmantas Baranauskas
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When compiling a java class, version number is included in each *.class file:

major version: 48 = Java SE 1.4.2
major version: 49 = Java SE 5
major version: 50 = Java SE 6

Your classes have been compiled on java 5, and you try to run them on Java <=1.4.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15281
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try searching in the forums or with Google for "UnsupportedClassVersionError" - this has been discussed before.
 
Sunny Gibbony
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes there are alot of perivous posts about this. It looks like maybe the JVM is older than the compiler. What is the command/process to check the version of the JVM or JRE?
 
Balasubramanian Chandrasekaran
Ranch Hand
Posts: 215
Firefox Browser Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ashlon Hill:
What is the command/process to check the version of the JVM or JRE?


To know version of your JDK you can use
%>javac -version

To know version number of your JRE you can use
%>java -version
in your Command Prompt(Terminal)
[ July 10, 2008: Message edited by: Balasubramanian Chandrasekaran ]
 
Sunny Gibbony
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes that is correct.

it was trying to use java 1.3 instead of java 1.5!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic