ant不支持的major.minor版本52.0 [英] ant Unsupported major.minor version 52.0

查看:92
本文介绍了ant不支持的major.minor版本52.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这真让我发疯.
当运行任何ant命令(甚至是ant -version)时,在Mac OSX上总是出现以下错误:

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

线程"main"中的异常java.lang.UnsupportedClassVersionError:org/apache/tools/ant/launch/Launcher:不支持的major.minor版本52.0

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

我完全删除并重新安装了ant,但仍然收到相同的错误.

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

对于我们公司,我们必须运行Java7来运行命令,因此我创建了一个别名.

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.

推荐答案

我看到您已经安装了Java 1.7,并发布了已安装Ant 1.10的信息.

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

Ant 1.10需要jdk 8 请参阅: http://ant.apache.org/

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

Apache Ant团队目前维护着两条开发线.这 1.9.x发行版在运行时需要Java5,而 1.10.x发行版在运行时需要Java8 .这两行均基于Ant 1.9.7和1.9.x版本 主要是错误修复版本,而其他新功能是 为1.10.x开发. 我们建议您使用1.10.x,除非您 在构建期间需要使用Java8之前的Java版本 过程.

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.

如果无法使用Java 8,请尝试使用Ant 1.9.x

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

这篇关于ant不支持的major.minor版本52.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆