我尝试编译我的 Android 项目,我得到了这个错误
[INFO] Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
[INFO] at java.lang.ClassLoader.defineClass1(Native Method)
[INFO] at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
[INFO] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[INFO] at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
[INFO] at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[INFO] at java.security.AccessController.doPrivileged(Native Method)
[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
[INFO] at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
我已经在其他文章中读到,尝试用 Java8编译可能会导致这个错误,但不是我的情况,我有以下 Java 版本:
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-0ubuntu0.14.04.2)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
操作系统: Linux Mint (I'm not have Java 8 installed.) 建造: MAVEN
有人能帮我吗?