Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ant Unsupported major.minor version 52.0

Tags:

ant

This is driving me nuts.
When running any ant command (even ant -version), I always get the following error on Mac OSX:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/tools/ant/launch/Launcher : Unsupported major.minor version 52.0

I removed and re-installed ant entirely, and still get the same error.

enter image description here

For our company we have to run Java7 to run the command, so I created an alias.

This used to work, I'm not sure what changed.

like image 391
html_programmer Avatar asked Mar 15 '18 15:03

html_programmer


1 Answers

I see you have java 1.7 installed and post that you have installed Ant 1.10.

Ant 1.10 requires jdk 8 Refer : http://ant.apache.org/

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. Both lines are based off of Ant 1.9.7 and the 1.9.x releases are mostly bug fix releases while additional new features are developed for 1.10.x. We recommend using 1.10.x unless you are required to use versions of Java prior to Java8 during the build process.

Try using Ant 1.9.x if you can't use java 8

like image 160
saurabh14292 Avatar answered Oct 01 '22 15:10

saurabh14292