简体   繁体   English

如何在Java 1.8上运行ant apt任务

[英]How to run ant apt task on java 1.8

On Ant Apt webiste there is information that trying to run ant apt task on java 1.8 will crash. 在Ant Apt网站上有信息,尝试在Java 1.8上运行ant apt任务会崩溃。 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. 但是在我必须更改的应用程序中,我必须使用此任务,因为它是内置在ant build中的,很难迁移到使用ant而不是使用javac和javax.annotations api。

Anyone have any idea how to avoid this crash and run Ant apt task on java 1.8. 任何人都知道如何避免此崩溃并在Java 1.8上运行Ant apt任务。

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 : apt工具及其相关com.sun的API自从Java 7的发布已经被弃用,并与Java 8项记载的释放完全移除相关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. apt注释处理框架是JDK特定的,并且可以追溯到JDK5。API的功能已通过JSR 269进行了标准化,JSR 269作为Java SE 6的一部分提供。在JDK 7中,不赞成使用apt API的全部。

[...] [...]

Users of annotation processing will have ample warning apt has been removed so needed migrations can occur before JDK 8 ships. 批注处理的用户将被删除很多警告,因此可以在JDK 8发行之前进行所需的迁移。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM