我正在尝试编译 ics-openconnect android 应用程序(https://github.com/cernekee/ics-openconnect)。
我跟着那个“自述文件”。但是,当我尝试调试时,它会发生错误。
错误:
-dex:
[dex] input: /home/yj/ics-openconnect/bin/classes
[dex] input: /home/yj/ics-openconnect/libs/openconnect-wrapper.jar
[dex] input: /home/yj/ics-openconnect/libs/acra-4.5.0.jar
[dex] input: /home/yj/ics-openconnect/libs/stoken-wrapper.jar
[dex] Pre-Dexing /home/yj/ics-openconnect/libs/openconnect-wrapper.jar -> openconnect-wrapper-58de756051305e9ad3753d649df24013.jar
[dx] Exception in thread "main" 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.defineClassCond(ClassLoader.java:631)
[dx] at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
[dx] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
[dx] at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
[dx] at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
[dx] at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
[dx] at java.security.AccessController.doPrivileged(Native Method)
[dx] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
[dx] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[dx] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
[dx] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
[dx] Could not find the main class: com.android.dx.command.Main. Program will exit.
BUILD FAILED
而且,我的java:
$java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
爪哇:
$javac -version
javac 1.6.0_45
我知道版本 52.0 的意思是“jdk 1.8”,但我只安装了 jdk 1.6
我该如何解决?