java - Annotation Processing Tool add code to existing class -


my goal add source code existing class using annotations.

first, create annotation , implemented abstractprocessor class. after create javax.annotation.processing.processor file , generate jar file using export eclipse option.

javax.annotation.processing.processor file

when use jar in other project have following error:

internal compiler error: java.lang.noclassdeffounderror: com/sun/source/util/trees @ org.xxx.preprocessor.actionprocessor.init(actionprocessor.java:44) 

and mentioned line joined picture:

actionprocessor.java:44

i want use tree in order compilation unit , add code annotated function.

so in first time don't know how fix problem, or way this.

you wrote ap tool based on sun internal code run inside of eclipse ide. eclipse comes it's own java compiler, don't have access internal java classes anymore.

i suggest @ project lombok has exact same problem , @ solution. source hides behind "contribute" link: https://github.com/rzwitserloot/lombok

in src/ folder folder eclipseagent/ should started.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -