Edge UI upgrade to 4.17.01 failing with Unsupported major.minor version 52.0 exception

When we are trying to upgrade the Edge UI component from 4.16.09 to 4.17.01, we are getting the following exception:

root@gtwtplapapiv01:~ # /opt/apigee/apigee-setup/bin/update.sh -c ui -f /tmp/ProdConfigFile
Using defaults from /tmp/ProdConfigFile
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Service upgrade: edge-ui
...
apigee-configutil: edge-ui: # OK
Exception in thread "main" java.lang.UnsupportedClassVersionError: utils/EncryptUtil : 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)

I have checked the Java version on the system is Java 8 for which the major.minor is 52.0

root@edgeui01:~ # java -version 
openjdk version "1.8.0_111" 
OpenJDK Runtime Environment (build 1.8.0_111-b15) 
OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)

Why am I still getting the exception Unsupported major.minor version 52.0 ?

Solved Solved
1 1 332
1 ACCEPTED SOLUTION

  1. The exception "Unsupported major.minor version 52.0" clearly indicates that there is a mismatch of the Java version that is used during upgrade vs the Java version in Edge component binaries.
  2. The "major.minor version 52.0" indicates that we need a Java 8 while running the upgrade scripts. However, we seem to be referring to Java 7 installation directory somewhere in the Edge UI upgrade scripts, so we are hitting this problem.
  3. Searched and found that the JAVA_HOME variable was pointing to Java 7 installation directory in <code>/opt/apigee/etc/defaults.sh</code>
  4. Modified the JAVA_HOME variable to point to Java 8 installation directory.

Post this change, the upgrade completed successfully.

View solution in original post

1 REPLY 1

  1. The exception "Unsupported major.minor version 52.0" clearly indicates that there is a mismatch of the Java version that is used during upgrade vs the Java version in Edge component binaries.
  2. The "major.minor version 52.0" indicates that we need a Java 8 while running the upgrade scripts. However, we seem to be referring to Java 7 installation directory somewhere in the Edge UI upgrade scripts, so we are hitting this problem.
  3. Searched and found that the JAVA_HOME variable was pointing to Java 7 installation directory in <code>/opt/apigee/etc/defaults.sh</code>
  4. Modified the JAVA_HOME variable to point to Java 8 installation directory.

Post this change, the upgrade completed successfully.