0

I'm trying to help setup H2 database on their work computer. We successfully ran the installation, but every time we try to run it, we get the following error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/h2/tool/Console : 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)
Could not find the main class: org.h2.tools.Console.  Program will exit.

Java 1.6 is on the computer. The only thing I can think off that is causing this is that jdk was not installed yet, but I'm not sure if that will resolve the issue. Has anyone seen this error before?

SVill
  • 331
  • 5
  • 22
  • 55

1 Answers1

0

The H2 classes you have have been compiled for Java 7 and above, so you need to upgrade your JVM to at least Java 7.

Since version 1.4.192 Java 7 is required (H2 build info)

It has previously been possible to compile the H2 drivers yourself for Java 6, not sure if tha source is still Java 6 compatible.

Roger Lindsjö
  • 11,330
  • 1
  • 42
  • 53