-1

While running Java program it is giving me and minor.major version mismatch error. I have JRE6.0 installed in my PC and no JDK version installed. The exception which I am getting is:

Exception in thread "main" java.lang.UnsupportedClassVersionError: otaclient/ClassFactory : Unsupported major.minor version 51.0
       at java.lang.ClassLoader.defineClass1(Native Method)
       at java.lang.ClassLoader.defineClassCond(Unknown Source)
       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$000(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 Intergrate.main(Intergrate.java:13)

Thanks in advance.

Vinay Lodha
  • 2,185
  • 20
  • 29
  • 1
    When you typed in the subject of this Q, and all those things popped up that answered it? You should look at them. – Brian Roach Apr 03 '14 at 09:32

3 Answers3

1

The code seems to be compiled on JDK 1.7. You need to be upgrade your JRE to run this code

Balwinder Singh
  • 2,272
  • 5
  • 23
  • 34
1

That class is compiled with a JDK 7, try it yourself. Run:

javap -verbose otaclient.ClassFactory

If you see 'major version: 51', it is was compiled with a JDK 1.7, see the Version of Class File section.

robermann
  • 1,722
  • 10
  • 19
0

I think the code you're trying to run was compiled with JDK 1.7, so you should upgrade your machine JRE to 1.7 or 1.8 to run it.

Xavier Coulon
  • 1,580
  • 10
  • 15