Solutions

Upgrading DS/OpenDJ (All versions) fails with UnsupportedClassVersion error

Last updated Aug 10, 2020

The purpose of this article is to provide assistance if the DS/OpenDJ server fails to upgrade to a later version with "Exception in thread "main" java.lang.UnsupportedClassVersionError".


Symptoms

An error similar to the following is shown when the upgrade fails:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/opends/server/tools/upgrade/UpgradeCli : Unsupported major.minor version 52.0  
   at java.lang.ClassLoader.defineClass1(Native Method)  
   at java.lang.ClassLoader.defineClass(ClassLoader.java:800)  
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)  
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)  
   at java.net.URLClassLoader.access$100(URLClassLoader.java:71)  
   at java.net.URLClassLoader$1.run(URLClassLoader.java:361)  
   at java.net.URLClassLoader$1.run(URLClassLoader.java:355)  
   at java.security.AccessController.doPrivileged(Native Method)  
   at java.net.URLClassLoader.findClass(URLClassLoader.java:354)  
   at java.lang.ClassLoader.loadClass(ClassLoader.java:425)  
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)  
   at java.lang.ClassLoader.loadClass(ClassLoader.java:358)  
   at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

The same error is shown in the Upgrade.log file.

Recent Changes

N/A

Causes

The version of DS/OpenDJ you are upgrading to requires a different version of Java® than the one running on your server. The Java versions required are as follows:

  • DS 7 - Java 11
  • DS 6.5.x - Java 8 or 11
  • DS 6 - Java 8 or 9
  • DS 5.5.x - Java 8
  • DS 5 - Java 7 or 8
  • OpenDJ 3.x - Java 7 or 8

See the release notes applicable to your version for further information, for example: DS 7 Release Notes › Java.

Solution

This issue can be resolved by installing the required version of Java and then enabling the server to use the newer version as detailed in How do I change DS/OpenDJ (All versions) to use a different JDK version?

Once Java is successfully updated, you can then upgrade the DS/OpenDJ server.

See Also

How do I ensure DS/OpenDJ (All versions) uses the Java settings from java.properties file when starting?

Upgrading DS/OpenDJ

Upgrade Guide

Related Training

N/A

Related Issue Tracker IDs

N/A



Copyright and TrademarksCopyright © 2020 ForgeRock, all rights reserved.
Loading...