Hi, I want to know the javac arguments to compile all the java files in subdirectories... the only way I know is when I go as deep in my directory structure and type : javac -d c:\project *.java Is there a way to compile all the java files in all the subdirectories of c:\project? thanks again /Daniela ps: Cindy I have allready posted this thread in begginer but nobody answered
When a project starts having several subdirectories, I would suggest using ant to help automate the build process. Ant can compile java code in multiple subdirectories and recreate that same directory structure in the destination directory. It also has many other useful features, and is written in java so it runs on windows, linux, solaris, etc... I hope that helps you. If you need any more help don't hesitate to ask. Chris
Joined: Dec 13, 2002
thank you Chris, I am doing my Java Developer certification and I have to provide the javac command line to SUN for them to compile my application... they probably know it huhu but they asked for it in the assignement...this is why I need to have it... Do you have any clue? daniela
I would create a file (named argfile or whatever) to list the directories to be compiled and then use: C:> javac @argfile Javac Instructions. This suggests also putting your options in a file and referencing that at the command line.
"JavaRanch, where the deer and the Certified play" - David O'Meara
I wrote this in a make.bat file for windows and it works fine for the following structure: App |_data |_gui |_helper TheApp.java - main file Type make in the directory above App. Hope this helped. Phil --- code --- @ECHO OFF ECHO compiling... javac App/data/*.java javac App/gui/*.java javac App/helper/*.java javac App/*.java ECHO done!
Originally posted by Daniela Ch: thank you Chris, I am doing my Java Developer certification and I have to provide the javac command line to SUN for them to compile my application... they probably know it huhu but they asked for it in the assignement...this is why I need to have it... Do you have any clue? daniela
You don't have to tell SUN who to compile your assignment - but you shall tell them who to run your program e.g. 'java -jar client.jar' But one easy way to compile is to use ANT. e.g. <javac srcdir="src" destdir="classes" /> This sample compiles all *.java in the 'src' dir. Rene [ December 31, 2002: Message edited by: Rene Larsen ]