Android SDK Manager error: Unsupported major.minor version 52.0

KMK picture KMK · Oct 8, 2017 · Viewed 8.1k times · Source

I want to use Qt to make an app for Android (and later hopefully iOS). I have downloaded the Android SDK Manager command line tool, and ran sdkmanager --list, but it gives the following error:

C:\Users\MyUser\Development\Android\sdk\tools\bin>sdkmanager --list

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/sdklib/tool/SdkManagerCli : 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'm using Windows 10.

I've added the path to the SDK Manager to the windows environment path, and have tried to run the command from both the bin directory and from another directory. I still get the error.

Some similar issues suggested to check/update the Java SE Development Kit. I've tried both version 7, 8 and 9, but I still get the same error.

I've also tried to run the command prompt as administrator. Still the same error.

I'm completely out of ideas...

Does anyone know what I'm doing wrong? I have no previous experience with Android app development or Java.

Answer

KMK picture KMK · Oct 9, 2017

Turned out that installing the Java SE Development kits wasn't enough. I also needed to manually update the system variable JAVA_HOME to point to the new directory.

Now I can run the SDK Manager without problems.