Page 1 of 1

Class files and .java files

Posted: Tue Oct 14, 2003 5:19 pm
by Jennifer Sohl
Hello! Is there anyway to make TextPad put the .class files into one folder and keep the .java files in a sepearate folder , while still being
able to run the program?
Right now, it seems I have to have the .class files and .java files in the same folder to run them in TextPad.

Thanks for any help!! :)

Posted: Tue Oct 14, 2003 6:21 pm
by talleyrand
Assuming you have the destination directory already created, pass the -d paramter to the javac executible with the name of the output directory.

F:\java>dir /s
F:\java\bin
F:\java\src
F:\java\src\Foo.java

F:\java>javac -d bin src\Foo.java

F:\java>dir /s
F:\java\bin
F:\java\src
F:\java\bin\Foo.class
F:\java\src\Foo.java

I'm too lazy to look through the fine TP help to remember what the parameter substitution should be on the output directory but you get the idea.