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

查看:29
本文介绍了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天全站免登陆