ant 和 java 8 - “主要版本 52 比 51 更新,这是此编译器支持的最高主要版本"; [英] ant and java 8 - "major version 52 is newer than 51, the highest major version supported by this compiler"

查看:66
本文介绍了ant 和 java 8 - “主要版本 52 比 51 更新,这是此编译器支持的最高主要版本";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的 ant 项目从 java 7 升级到 java 8.
(该项目部署在Eclipse Kepler"中,Java™ 8 支持 Eclipse Kepler SR2")

I am trying to upgrade my ant project from java 7 to java 8.
(the project deployed in "Eclipse Kepler" with "Java™ 8 support to Eclipse Kepler SR2")

为此,我下载了 ant 1.9.4(根据这篇文章http://wiki.eclipse.org/Ant/Java8) ,并将其配置为我的蚂蚁之家".

For that i downloaded ant 1.9.4 ( according this post http://wiki.eclipse.org/Ant/Java8) , and configure it's as my "ant home".

当我尝试编译时收到以下警告:<代码>主要版本 52 比 51 更新,这是此编译器支持的最高主要版本.[javac] 建议升级编译器."

when i am trying to compile a got the following warning: "major version 52 is newer than 51, the highest major version supported by this compiler. [javac] It is recommended that the compiler be upgraded."

但是为工作区定义的编译器是 1.8.(在 ant 配置中,它将编译器定义为与工作空间相同的编译器..)

But the compiler that defined for the workspace is 1.8. (In the ant configuration it's define the compiler to be the same compiler of the work space..)

知道发生了什么吗?

非常感谢.

艾尔

推荐答案

请检查 Ant 使用的 tools.jar 是否来自 JDK8 而不是 JDK7.

Please check that the tools.jar used by Ant is from JDK8 and not JDK7.

窗口 -> 首选项:

在左窗格中,转到 Ant -> 运行时.在 Classpath 选项卡中,检查 Global Entries.

In the left pane, go to Ant -> Runtime. In the Classpath tab, check the Global Entries.

这篇关于ant 和 java 8 - “主要版本 52 比 51 更新,这是此编译器支持的最高主要版本";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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