Hello, Could you please tell, how to compile a class with a package statement. I mean the class should go to the perticular directory. Thanks
SCJP 1.4, SCMAD 1.0<br />SCWCD, SCBCD (in progress)
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
posted
0
From the javac documentation note that the -d option specifies that compiled classes are to be placed in the directory specified after the -d switch. Also note it says that "[i]f a class is part of a package, javac puts the class file in a subdirectory reflecting the package name, creating directories as needed." Another thing to note is that if you're working from a command prompt and you'd like the package directories to be created in the current working directory, the easy thing to do is to just use a period "." following the -d switch. The period specifies that the current working directory is to be used.