Setting up Java Packages

In general, the Java class packages should be set up and compiled as described in this section.

The following topics are discussed:

Java Package Structure

This section defines the directory structure of the Java packages.

company/classes/product/package/*.class

where:

Path Element Definition
company The company name.
/classes Indicates that the directories below this contain class files.
/product The application product name.
/package These subdirectories are named for the class packages and they contain the class files.
/*.class The various class files.

The ENOVIA Live Collaboration classes are provided in this structure:

matrix/classes/matrix/client/*.class
matrix/classes/matrix/resource/*.class
matrix/classes/matrix/db/*.class
matrix/classes/matrix/vui/*.class
matrix/classes/matrix/util/*.class
matrix/classes/matrix/common/*.class
matrix/classes/matrix/matrix/*.class

You should customize the structure to indicate your company and product, and any packages that you create. For example:

acme/classes/widget/client/*.class
acme/classes/widget/db/*.class
acme/classes/widget/vui/*.class
acme/classes/widget/util/*.class
acme/classes/widget/common/*.class
acme/classes/widget/matrix/*.class
acme/classes/widget/acmepackage1/*.class

You should create a similar structure for your Java source code. Replace the classes subdirectory with source so that the directory structure for your Java source code will be familiar. The source Java files contain the methods in the classes used for the implementation of the classes. For example:

acme/source/widget/client/*.java
acme/source/widget/db/*.java
acme/source/widget/vui/*.java
>acme/source/widget/util/*.java
acme/source/widget/common/*.java
acme/source/widget/matrix/*.java
acme/source/widget/acmepackage1/*.java

Compiling Java Classes

When you compile using your Java class packages, you must specify the exact order in which the compiler searches for class files.

Specifying the search order is typically done through the environment variable CLASSPATH. Alternatively, if you work in a development environment like Symantec Cafe, CLASSPATH may be modified in the project file settings.

ENOVIA Live Collaboration classes are contained in the file ENOVIA_INSTALL/java/classes/eMatrixAppletDownloadXML.jar, which can be used to compile against. For example, use the following CLASSPATH statement:

CLASSPATH = ENOVIA_INSTALL/java/classes/eMatrixAppletXML.jar

If multiple .jar files exist, use CLASSPATH to specify the search order. For example, if there are two files called widget.class (one in the acme.jar file and one in the eMatrixAppletDownloadXML.jar file), and the one in acme.jar is the one you want to use, you must indicate this in the CLASSPATH statement. To search the acme.jar file first, specify the acme path before the matrix path in the CLASSPATH statement:

CLASSPATH = /acme/classes/acme.jar;ENOVIA_INSTALL/java/classes/
eMatrixAppletXML.jar;...

The compiler will search the acme path first and locate the widget.class file in the acme.jar file. The widget.class in eMatrixAppletDownloadXML.zip will not be used.