HOWTO: Handling Packages with the Visual J++ CompilerID: Q162129
|
When the Visual J++ compiler, Jvc.exe, sees a package statement, it automatically creates the directory structure needed for the package declared. The .class files that define the classes in the package must be placed in this directory structure. By default, they are not placed in the correct directory. You must specify an output directory to tell the compiler where to place the .class files.
The .class files that define the classes in a package must be placed in a
directory that matches the package name. For example if you were to define
a package called "animals.dogs," the .class files that define the classes
in this package must be located in the "animals\dogs" directory.
In order for the compiler to place the .class files in the correct
directory, you must specify an output directory by clicking Settings on the
Build menu. The Project Settings dialog box appears. Click the General tab
if it is not already selected.
You will see two edit boxes, the second of which is labeled "Output
Directory." The directory entered here is used as the root of the directory
structure created for a package. If using the command line, Jvc.exe has a
"/d" command line switch that lets you specify the output directory. You
can also use a "." as the output directory and the compiler creates the
necessary directories under the current structure and places the .class
files there.
Thus if you entered c:\msdev\projects\packtest for the output directory,
and you compiled a .class file with the package statement above, the
following directory is created:
c:\msdev\projects\packtest\animals\dogs
The resulting class files are placed in this directory.
c:\<win-dir>\Java\Classes
This directory is automatically included in the classpath. If you choose
not to use a central repository, each time you create a package, you must
add an additional entry to your classpath.
For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, see the following pages on the Microsoft Technical Support site:
http://support.microsoft.com/support/visualj/
http://support.microsoft.com/support/java/
Additional query words:
Keywords : kbusage kbCommandLine kbGenInfo kbVJ kbVJ100 kbVJ110
Version : 1.0 1.1
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: July 27, 1999