如何在 java 1.8 上运行 ant apt 任务 [英] How to run ant apt task on java 1.8

查看:25
本文介绍了如何在 java 1.8 上运行 ant apt 任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Ant Apt 网站上有信息说尝试在 java 1.8 上运行 ant apt 任务会崩溃.但是在我必须更改的应用程序中,我必须使用此任务,因为它内置于 ant build 中,并且很难迁移到使用而不是 ant apt 使用 javac 和 javax.annotations api.

On Ant Apt webiste there is information that trying to run ant apt task on java 1.8 will crash. But in application that i have to change i must use this task because it is built in ant build and is too hard to migrate to using instead of ant apt use javac and javax.annotations api.

任何人都知道如何避免这种崩溃并在 java 1.8 上运行 Ant apt 任务.

Anyone have any idea how to avoid this crash and run Ant apt task on java 1.8.

推荐答案

你别无选择,你必须迁移.

apt 工具及其相关的 com.sun API 自 Java 7 发布以来已被弃用,并随着 Java 8 的发布被完全删除.如前所述在相关JEP中:

The apt tool and its associated com.sun APIs have been deprecated since the release of Java 7, and were removed completely with the release of Java 8. As stated in the relevant JEP:

apt 注释处理框架是特定于 JDK 的,可以追溯到 JDK 5.API 的功能使用 JSR 269 进行了标准化,JSR 269 作为 Java SE 6 的一部分提供.在 JDK 7 中,整个 apt API 是已弃用.

The apt annotation processing framework is JDK-specific and dates back to JDK 5. The functionality of the API was standardized with JSR 269, which shipped as part of Java SE 6. In JDK 7, the entirety of the apt API was deprecated.

[...]

注释处理的用户将收到大量警告 apt 已被删除,因此可以在 JDK 8 发布之前进行所需的迁移.

Users of annotation processing will have ample warning apt has been removed so needed migrations can occur before JDK 8 ships.

这篇关于如何在 java 1.8 上运行 ant apt 任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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