• Post Reply Bookmark Topic Watch Topic
  • New Topic

compiling java files  RSS feed

 
vidya sri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using single java command is it possible to compile all java files in its current directory and all of its sub directory.If so what is the command and syntax.

(javac *.java)-which is used to compile all java files in a current directory.

Whats the command for compiling in sub directories too???
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no command to do that explicitly. But javac will also compile any source files that the classes it compiles depend on, if no class files for those are present. So if certain class files are missing, and the source files about to be compiled depend on those, they will be compiled as well.

Tools like the javac task in Ant have an option to specify that all changed source files should be recompiled, but not javac itself.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On a UNIX-like operating system, you could type

javac `find . -name '*.java'`

On Windows, you're lucky to be allowed to type at all.
[ May 25, 2007: Message edited by: Ernest Friedman-Hill ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!