Android 打包出现 jdk 版本错误的问题,本质上是 SDK 的问题,与 JDK 无关。如果 SDK 的 API 是24或者更高,就要求 jdk 1.8,我这里指定的 API 是22,所以去勾选22的 SDK Platform 进行安装。
[dex] Pre-Dexing D:JenkinsworkspaceAndroidBugtags-Android-Eclipse-Libinclasses.jar -> classes-3f7282283aa00 a87ee9fdbff3a356d8b.jar [dx] java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0 [dx] at java.lang.ClassLoader.defineClass1(Native Method) [dx] at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [dx] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [dx] at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) [dx] at java.net.URLClassLoader.access$100(URLClassLoader.java:71) [dx] at java.net.URLClassLoader$1.run(URLClassLoader.java:361) [dx] at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [dx] at java.security.AccessController.doPrivileged(Native Method) [dx] at java.net.URLClassLoader.findClass(URLClassLoader.java:354) [dx] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) [dx] at java.lang.ClassLoader.loadClass(ClassLoader.java:412) [dx] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) [dx] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [dx] at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482) [dx] Exception in thread "main"