The Java class path
The
Java class path is a list of directories and archive files that
specify where to look for applets, JavaBeans, and other files containing
Java code. PowerBuilder uses the class path to find the Java classes
it lists in the System Tree.
PowerBuilder searches the directories in the class path and
their subdirectories. It also searches the contents of the ZIP and
JAR archive files listed in the class path. It determines whether
any of the files are Java CLASS files and whether they are applets
or JavaBeans. If it finds more than one CLASS file with the same
name, only the first one appears in the System Tree.
Class path values
When using Web targets, there are two possible values for
the class path:
- System default
class path This value is stored in the CLASSPATH environment variable.
System options class path The Java page of the System Options dialog box lets you list
directories and archive files to be searched in addition to those
listed in the system default class path (without changing the system
default value).To go to the Java page
of the System Options dialog, you can either:- Select
Tools>System Options from the menu bar and click the Java tab. - Right-click anywhere in the Components tab of the
System Tree and select Java Classpath from the pop-up menu.
- Select
If the Java VM has already started, you can see the effects
of your changes by restarting PowerBuilder and expanding a Java branch
on the Components tab of the System Tree.
Using the class path
The class path value in use during your Web target session
depends on how the Java VM starts. PowerBuilder starts the Java VM
in these situations:
- The first time you look
at a page that contains a Java applet, the Java VM starts automatically
using the default system class path. The system options class path
is not used. - When you expand a Java branch on the Components
tab of the System Tree, the Java VM starts using a combination of
the system options and system default class paths.
Once the Java VM is started, it remains running until you
exit your workspace.
When you include a Java applet in your document, the Applet
element provides a CODEBASE attribute that specifies where to find
the applet on the server. The class path setting on the user’s
computer is irrelevant.
Viewing results of class path changes in the System
Tree If you use the Java tab of the System Options dialog box to
change the class path after the Java VM is started in your current
session, you must restart PowerBuilder to see the result. Even then,
your changes take effect only after the Java VM starts as a result
of actions in the System Tree.