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

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

问题描述

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

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

解决方案

您别无选择,必须迁移.

自Java 7发行以来,已经不推荐使用apt工具及其相关的com.sun API,并且随着Java 8的发布而被完全删除. java.net/jeps/117"rel =" nofollow>相关的JEP :

apt注释处理框架是特定于JDK的,其历史可以追溯到JDK5.API的功能已通过JSR 269进行了标准化,该JSR 269是Java SE 6的一部分.不推荐使用.

[...]

注释处理用户将被删除很多警告,因此可以在JDK 8发行之前进行所需的迁移.

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.

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

解决方案

You have no choice, you must migrate.

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:

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.

[...]

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天全站免登陆