1

I was trying to find an example usage of the -s option for the java compiler but failed. Could anyone explain or give me an example on how the -s option works? The Oracle document has the following explanation: Specify the directory where to place generated source files. I have no idea when the java compiler will generate source files.

1 Answers1

1

javac -s option will specify "generated code" where to go. It only happens if there is some code to generated, using java compiler API. You could use annotation processor to generate code base on annotated code as well. An useful example could found here: http://deors.wordpress.com/2011/10/31/annotation-generators/

Casper Ngo
  • 343
  • 2
  • 8
  • When looking at the source of the JavacFileManager, I found the following comments: The output directory, used when generating sources while processing annotations. Initialized by the "-s" option which supports this answer. Thanks! – user2800002 Sep 21 '13 at 16:04