I'm wondering about how to use javac command options in the windows command line. I've looked up several tutorials, including Oracle's. I want to be able to create a batch file that finds the source code in one folder and places the compiled classes in another.
The javac documentation contains a section that describes exatcly this in some detail. Have a look at the examples posted there, especially the one under heading 'Separating Source Files and Class Files'. It's hard to give any useful suggestions specific to your situation without knowing more about the error message and the directory sctructure.
On a related note, you said you're looking to script the javac call in a batch (.bat) file. I suggest you have a look at Apache ANT instead.
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Joined: Nov 05, 2010
My instructor is offering bonus marks if we "Deliver your project so it can be built with ant". I can't believe I hadn't even though of using an ANT script; I'll definitely look into that.
In the meantime, why won't my batch file work?
I'm in the current directory, which contains:
Beans is the package name. The package beans under the src directory, contains my .java files. The package beans under classes is empty. I want to compile those .java files (in src\beans) and put all the .class files in the "classes\beans" package.
Thanks for the input so far!
subject: Using Javac Command Line Options in Windows