How to run ant apt task on java 1.8

 ̄綄美尐妖づ 提交于 2019-12-08 05:34:13

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/26733125/how-to-run-ant-apt-task-on-java-1-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!