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.
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:
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
Post a Comment