Java – Major .minor version 52.0 using ant is not supported

Major .minor version 52.0 using ant is not supported… here is a solution to the problem.

Major .minor version 52.0 using ant is not supported

I’m trying to compile the ics-openconnect android app (。

I followed the “readme”. However, when I try to debug, I get an error.


  [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(
   [dx]     at java.lang.ClassLoader.defineClass(
   [dx]     at
   [dx]     at
   [dx]     at$000(
   [dx]     at$
   [dx]     at Method)
   [dx]     at
   [dx]     at java.lang.ClassLoader.loadClass(
   [dx]     at sun.misc.Launcher$AppClassLoader.loadClass(
   [dx]     at java.lang.ClassLoader.loadClass(
   [dx] Could not find the main class: Program will exit.


Also, my 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

I know version 52.0 says “JDK 1.8”
But I only installed JDK 1.6

How do I fix it?

Related Problems and Solutions