8

I wish to use the Java compiler tree in Eclipse. I have come across the API itself on the Oracle web site here, however I cannot find the JAR file for the library. Am I missing something?!

1 Answer 1

15

Use:

com.sun.source.tree.*
com.sun.source.util.*

The above packages can be found in tools.jar. Please add tools.jar to classpath. You can find tools.jar in <JDK_HOME>/lib folder. Also, you can extract src.zip and find the related API source files there.

Sign up to request clarification or add additional context in comments.

2 Comments

Still, "How to set it up"?Like for Annotation processors, there seems to be some entry in a META-INF file that makes your tree-aware class known to javac. Anyone knows a good example for com.sun.source.tree.*?
And the instructions for installing the javadocs can be found here: stackoverflow.com/questions/4517004/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.