0

I have installed ANT on my machine , I have set the environment variables for ANT_HOME , when i am trying to test the ant installation through command window console by providing the below command ant -v I am getting the below error

enter code hereC:\Users\XXXXXX>ant -v Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/to ols/ant/launch/Launcher : Unsupported major.minor version 52.0

But i have checked the JDK version and JRE Version , both seems to be the same . PFB the output of the versions respectively

C:\Users\XXXXX>java -version java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

C:\Users\XXXXX>javac -version javac 1.7.0_80

Compiler versions and run time versions both are same , what could be the issue here

  • 1
    Isn't 52.0 a Java 8 compiled class? In which case, the report of Java 7 would indicate you need to update to Java 8. Edit: Ant 1.10.x requires Java 8 runtime. See the requirements at ant.apache.org. – KevinO Mar 13 '17 at 21:15
  • yes thats correct , initially i installed it jdk version 8 and then uninstalled and restarted my laptop and then installed jdk version 7 again , many of my existing applications were using only jdk 7 – Muthu Palaniappan Mar 13 '17 at 21:17
  • You still have multiple versions of Java installed somewhere. – Jim Garrison Mar 13 '17 at 21:18

1 Answers1

5

According to the (current) ant home page

The Apache Ant team currently maintains two lines of development. The 1.9.x releases require Java5 at runtime and 1.10.x requires Java8 at runtime

You'll need Java 8.

chindo
  • 61
  • 5
stdunbar
  • 16,263
  • 11
  • 31
  • 53