Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Recursive compilation

843810Nov 7 2002 — edited Nov 10 2002
I've been told that you can specify only a directory, and javac will recursively compile all the code in the directory, e.g.:
javac -sourcepath ./src -d ./classes 
without specifying the specific source files, and that javac can handle this, by compiling everything under src/.

I've tried it, checked the docs, etc., and can find no evidence this is true.

Also I'm told you can compile, using package names:
javac -sourcepath ./src -d ./classes com.my.package.name
And that javac will look in src and find com/my/package/name.java and/or com/my/package/name/*.java, and compile them.

Similarly, I've tried it, checked the docs, etc., and can't get it to work or find any evidence that it's ever worked.

Am I doing something wrong? Is it really possible to use javac this way? Or do you have to specify real filenames on the command line to javac, and to do anything like I'm describing, you have to start using a real build tool, like make or ant?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 8 2002
Added on Nov 7 2002
3 comments
336 views