I\'ve used the java compiler tree api to generate the ast for java source files. However, i\'m unable to access th comments in the source files.
So far, i\'ve been
You might to use a different tool, like ANTLR's Java grammar. javac has no use for comments, and is likely to discard them completely. The parsers upon which tools like IDEs are built are more likely to retain comments in their AST.
javac