java.lang.UnsupportedClassVersionError

tip

Update "latest" to Java 8 on DockerHub.

tip

You're using an older version of java with classes compiled for java7

tip

This might be caused by and outdated version of Java, SonarQube now uses Java 8 as default. You might upgrade java or use an older version of SonarQube.

tip

If you're using intellij plugin of sonarqube, you might have to set the JAVA_HOME ambient variable manually.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Skip to content Using Gmail with screen readers Take me to Inbox 8 of 6,752 to Dspace Dear Friends, I got following error in the final step of Dspace installation. You got such errors before? root@user1:/build/dspace-5.1-src-release/dspace/target/dspace-installer# sudo ant fresh_install Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar Buildfile: /build/dspace-5.1-src-release/dspace/target/dspace-installer/build.xml init_installation: init_configs: [copy] Copying 41 files to /dspace/config [copy] Copying 1 file to /dspace/config test_database: [java] Exception in thread "main" java.lang.UnsupportedClassVersionError: org/dspace/storage/rdbms/DatabaseUtils : Unsupported major.minor version 51.0 [java] at java.lang.ClassLoader.defineClass1(Native Method) [java] at java.lang.ClassLoader.defineClass(ClassLoader.java:643) [java] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [java] at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) [java] at java.net.URLClassLoader.access$000(URLClassLoader.java:73) [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:212) [java] at java.security.AccessController.doPrivileged(Native Method) [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:205) [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:323) [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:268) [java] Could not find the main class: org.dspace.storage.rdbms.DatabaseUtils. Program will exit. BUILD FAILED /build/dspace-5.1-src-release/dspace/target/dspace-installer/build.xml:797: Java returned: 1 Total time: 4 seconds
    via by vimal,
  • Skip to content Using Gmail with screen readers Take me to Inbox 8 of 6,752 to Dspace Dear Friends, I got following error in the final step of Dspace installation. You got such errors before? root@user1:/build/dspace-5.1-src-release/dspace/target/dspace-installer# sudo ant fresh_install Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar Buildfile: /build/dspace-5.1-src-release/dspace/target/dspace-installer/build.xml init_installation: init_configs: [copy] Copying 41 files to /dspace/config [copy] Copying 1 file to /dspace/config test_database: [java] Exception in thread "main" java.lang.UnsupportedClassVersionError: org/dspace/storage/rdbms/DatabaseUtils : Unsupported major.minor version 51.0 [java] at java.lang.ClassLoader.defineClass1(Native Method) [java] at java.lang.ClassLoader.defineClass(ClassLoader.java:643) [java] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [java] at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) [java] at java.net.URLClassLoader.access$000(URLClassLoader.java:73) [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:212) [java] at java.security.AccessController.doPrivileged(Native Method) [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:205) [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:323) [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:268) [java] Could not find the main class: org.dspace.storage.rdbms.DatabaseUtils. Program will exit. BUILD FAILED /build/dspace-5.1-src-release/dspace/target/dspace-installer/build.xml:797: Java returned: 1 Total time: 4 seconds
    via by vimal,
  • Crosscompilation
    via GitHub by MarcDahlem
    ,
  • Issues after ES 1.3.2 upgrade
    via GitHub by praj2
    ,
    • java.lang.UnsupportedClassVersionError: org/dspace/storage/rdbms/DatabaseUtils : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:643) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) at java.net.URLClassLoader.access$000(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:212) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:268)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    193 more bugmates