Installing the PJEE


The PJEE can be installed on either Microsoft Windows 95/NT or Solaris. The PJEE download page contains the following platform-specific PJEE installation programs:

PlatformInstallation ProgramDescription
Microsoft Windows 95/NT pjee3-win32.exe A self-extracting application for installing the PJEE.
Solaris 2.5 or greater pjee3-solaris.sh A self-extracting shell script for installing the PJEE.

Microsoft Windows 95/NT

Hardware Requirements

Software Requirements

Installation

The following steps describe how to install the PJEE on a Microsoft Windows 95/NT-based system.

  1. (Optional.) Remove any previous versions of the PJEE or JRE. This step helps to avoid software conflicts with this version of the PJEE.

  2. Download the PJEE installation program for Microsoft Windows 95/NT from the PJEE download page.

  3. Drag the PJEE installation program's icon to the target installation directory.

  4. Run the PJEE installation program. The PJEE installation program will perform some tests and present a few dialogs during the installation process. These include a dialog that prompts the user to agree to a binary license before installing the PJEE and a dialog that selects a destination directory.

  5. Select a system locale based on the ISO 8859-1 (Latin-1) character set.

    1. Choose Control Panel->Regional setting->Region

    2. Select English (United States).

The PJEE can now be used. Additional steps may be necessary to correctly define the PATH and CLASSPATH environment variables. This is important in cases where a system has another version of a Java application environment, like the JDK, or additional Java class files that have been installed separately from the PJEE. In these cases, the PATH and CLASSPATH environment variables may need modification to avoid conflicts.

PATH

The PATH environment variable defines a list of directories that the DOS shell uses as a search path for finding executable programs like the PJEE invocation tools (pjava and pappletviewer).

Here's how to add a directory to the PATH environment variable:

  1. Use a text editor to edit C:\autoexec.bat, the DOS shell startup file.

  2. Find the PATH environment variable definition. For example,

    PATH=C:\windows;C:\tools\bin
    

  3. Add the absolute path of the PJEE-dir\bin directory to the list of directories in the PATH definition. For example, if the PJEE has been installed in a directory named C:\PJEE-dir, then the absolute path of the directory containing the invocation tools is:

    C:\PJEE-dir\bin
    

    The above string would then be inserted into the list of directories in the PATH definition. For example,

    PATH=C:\PJEE-dir\bin;C:\windows;C:\tools\bin
    

    If the PATH environment variable definition contains more than one directory, a semi-colon (;) is used as a name separator.

  4. Save the changes to the DOS shell startup file.

  5. Quit the text editor.

  6. Restart Microsoft Windows 95/NT.

CLASSPATH

Many of the problems users have with getting a Java application to run properly on a specific Java application environment can be traced to a misdefined CLASSPATH environment variable. In principle, all that is required is that each of the application's class and resource files be stored in one of the locations in the CLASSPATH environment variable. But in practice, the CLASSPATH environment variable can have many different kinds of name conflicts.

The following two sub-sections provide background material on the CLASSPATH environment variable and a set of procedures for modifying the CLASSPATH environment variable.

Background

Java applications are collections of class and resource files that are built on one system and then installed on potentially many different target platforms. The file system on a target platform may be very different than the development platform. For example, target platforms may organize class files in different ways or they may have multiple Java applications or class libraries. Therefore, Java application environments like the PJEE use the CLASSPATH environment variable as a flexible mechanism for balancing the needs of platform-independence and the realities of file systems on different target platforms.

The CLASSPATH environment variable allows the Java virtual machine to load classes that depend on other Java classes which are not part of the default platform class library. If the virtual machine finds a file with the correct file name, it attempts to load it. Otherwise, it generates a NoClassDefFoundError error.

The CLASSPATH environment variable defines a list of locations that the Java virtual machine uses as a search path for finding class and resource files. A location can be either a directory in a file system or a Zip archive file that contains class or resource files. Locations in the CLASSPATH environment variable are delimited by a platform-dependent name separator (e.g. a semi-colon ";" on Microsoft Windows 95/NT). For example,

CLASSPATH=C:\java\MyClasses;\java\MoreClasses.zip

The Java programming language uses packages to organize classes into a hierarchical namespace. For example, java.awt.image is a package that contains a number of image-related classes. When the virtual machine searches the locations in the CLASSPATH environment variable, it uses each location as a root for performing a search. In the case of java.awt.image.BufferedImageOp the virtual machine would start with each location in the CLASSPATH environment variable and then try to find a subdirectory named java\awt\image that contains a class file named BufferedImageOp.class. This search method is applied to both file system directories and virtual directories in Zip files.

Since the CLASSPATH environment variable is not required by the default PJEE installation, the DOS shell startup file may not have a definition statement for it. The CLASSPATH environment variable can be removed if no extra directories are needed beyond the default set described above. By default, the CLASSPATH definition used internally by pjava is

CLASSPATH=PJEE-dir\lib\classes.zip;.

The -classpath comand line option for pjava overrides the current CLASSPATH environment variable definition.

Modifying CLASSPATH

Here's how to modify the CLASSPATH environment variable definition:

  1. Use a text editor to edit C:\autoexec.bat, the DOS shell startup file.

  2. Find the CLASSPATH environment variable definition. For example,

    CLASSPATH=C:\java\MyClasses
    

  3. Modify the CLASSPATH definition to add or remove directories. The example directory below contains class files for a Java application.

    C:\java\OtherClasses
    

    The above string would then be inserted into the list of directories in the CLASSPATH definition. For example,

    CLASSPATH=C:\java\MyClasses;C:\java\OtherClasses
    

    If the CLASSPATH environment variable definition contains more than one location, a semi-colon (;) is used as a name separator.

  4. Save the changes to the DOS shell startup file.

  5. Quit the text editor.

  6. Restart Microsoft Windows 95/NT.

Native Method Search Path

The PJEE installation program manages the task of installing DLLs that contain implementations of native methods used by the PersonalJava class library.

If additional native method DLLs are needed, then they should either be placed in the PJEE-dir\bin directory or in one of the directories in the PATH environment variable which is used by the Microsoft Windows 95/NT runtime as a search path for finding DLLs.

Removing the PJEE

The following steps describe how to remove the PJEE from a Microsoft Windows 95/NT system.

  1. Run the removal utility. When the PJEE installation program for Microsoft Windows 95/NT installs the PJEE, it adds a removal utility with the Windows Registry.

    1. Open the Control Panel folder by choosing Settings->Control Panel from the Start menu in the Task Bar

    2. Launch the Add/Remove Programs utility.

    3. Select the PJEE from the software list.

    4. Press the Add/Remove button.

  2. Restore the PATH or CLASSPATH environment variables to their original values. If these environment variables have been modified during the PJEE installation procedure, their original definitions should be restored.

Solaris

Hardware Requirements

Software Requirements

Installation

The following steps describe how to install the PJEE on a Solaris-based system.

Note: The procedures below describe how to set various environment variables. There are many different mechanisms for defining environment variables because there are several different UNIX shell programs (e.g. csh(1), sh(1) and ksh(1)), each with one or more mechanisms for defining environment variables. The actual method used in the procedures below is based on the setenv command for the csh(1) shell.

  1. (Optional.) Remove any previous versions of the PJEE or JRE. This step helps to avoid software conflicts with this version of the PJEE.

  2. Change the shell's current directory to the target installation directory.

    % cd install-directory
    

    The PJEE installation program will unpack the PJEE software into the shell's current directory, even if the PJEE installation program is in a different directory.

  3. Download the PJEE installation program for Solaris from the PJEE download page.

  4. Run the PJEE installation program.

    % ./pjee3-solaris.sh
    

    The PJEE installation program will prompt the user to agree to a binary license before installing the PJEE.

  5. Select a system locale based on the ISO 8859-1 (Latin-1) character set. This is controlled by the LANG environment variable. For example,

    % setenv LANG en_US
    

The PJEE can now be used. Additional steps may be necessary to correctly define the PATH, CLASSPATH and LD_LIBRARY_PATH environment variables. This is important in cases where a system has another version of a Java application environment, like the JDK, or additional Java class files that have been installed separately from the PJEE. In these cases, the PATH and CLASSPATH environment variables may need modification to avoid conflicts.

PATH

The PATH environment variable defines a list of directories that the UNIX shell uses as a search path for finding executable programs like the PJEE invocation tools (pjava and pappletviewer).

Here's how to add a directory to the PATH environment variable:

  1. Use a text editor to edit ~/.cshrc, the csh(1) shell startup file.

  2. Find the PATH environment variable definition. For example,

    setenv PATH .:/bin:/usr/bin:/usr/sbin
    

  3. Add the absolute path of the PJEE-dir\bin directory to the list of directories in the PATH definition. For example, if the PJEE has been installed in a directory named /java/PJEE-dir then the absolute path of the directory containing the invocation tools is:

    /java/PJEE-dir/bin
    

    The above string would then be inserted into the list of directories in the PATH definition. For example,

    setenv PATH .:/java/PJEE-dir/bin:/bin:/usr/bin:/usr/sbin
    

    If the PATH environment variable definition contains more than one directory, a colon (:) is used as a name separator.

  4. Save the changes to the shell startup file.

  5. Quit the text editor.

  6. Restart the shell.

CLASSPATH

Many of the problems users have with getting a Java application to run properly on a specific Java application environment can be traced to a misdefined CLASSPATH environment variable. In principle, all that is required is that each of the application's class and resource files be stored in one of the locations in the CLASSPATH environment variable. But in practice, the CLASSPATH environment variable can have many different kinds of name conflicts.

The following two sub-sections provide background material on the CLASSPATH environment variable and a set of procedures for modifying the CLASSPATH environment variable.

Background

Java applications are collections of class and resource files that are built on one system and then installed on potentially many different target platforms. The file system on a target platform may be very different than the development platform. For example, target platforms may organize class files in different ways or they may have multiple Java applications or class libraries. Therefore, Java application environments like the PJEE use the CLASSPATH environment variable as a flexible mechanism for balancing the needs of platform-independence and the realities of file systems on different target platforms.

The CLASSPATH environment variable allows the Java virtual machine to load classes that depend on other Java classes which are not part of the default platform class library. If the virtual machine finds a file with the correct file name, it attempts to load it. Otherwise, it generates a NoClassDefFoundError error.

The CLASSPATH environment variable defines a list of locations that the Java virtual machine uses as a search path for finding class and resource files. A location can be either a directory in a file system or a Zip archive file that contains class or resource files. Locations in the CLASSPATH environment variable are delimited by a platform-dependent name separator (e.g. a colon ":" on Solaris). For example,

setenv CLASSPATH /java/MyClasses:/java/MoreClasses.zip

The Java programming language uses packages to organize classes into a hierarchical namespace. For example, java.awt.image is a package that contains a number of image-related classes. When the virtual machine searches the locations in the CLASSPATH environment variable, it uses each location as a root for performing a search. In the case of java.awt.image.BufferedImageOp the virtual machine would start with each location in the CLASSPATH environment variable and then try to find a subdirectory named java/awt/image that contains a class file named BufferedImageOp.class. This search method is applied to both file system directories and virtual directories in Zip files.

Since the CLASSPATH environment variable is not required by the default PJEE installation, the shell startup file may not have a definition statement for it. The CLASSPATH environment variable can be removed if no extra directories are needed beyond the default set described above. By default, the CLASSPATH definition used internally by pjava is

setenv CLASSPATH=PJEE-dir/lib/classes.zip:.

The -classpath comand line option for pjava overrides the current CLASSPATH environment variable definition.

Modifying CLASSPATH

Here's how to modify the CLASSPATH environment variable definition:

  1. Use a text editor to edit ~/.cshrc, the csh(1) shell startup file.

  2. Find the CLASSPATH environment variable definition. For example,

    setenv CLASSPATH /java/MyClasses
    

  3. Modify the CLASSPATH definition to add or remove directories. The example directory below contains class files for a Java application.

    /java/OtherClasses
    

    The above string would then be inserted into the list of directories in the CLASSPATH definition. For example,

    setenv CLASSPATH /java/MyClasses:/java/OtherClasses
    

    If the CLASSPATH environment variable definition contains more than one location, a colon (:) is used as a name separator.

  4. Save the changes to the shell startup file.

  5. Quit the text editor.

  6. Restart the shell.

Native Method Search Path

The PJEE installation program manages the task of installing shared libraries that contain implementations of native methods used by the PersonalJava class library.

If additional native method shared libraries are needed, then they should either be placed in the PJEE-dir/lib/sparc directory or in one of the directories in the LD_LIBRARY_PATH environment variable which is used by the Solaris runtime as a search path for finding shared libraries.

Removing the PJEE

The following steps describe how to remove the PJEE from a Solaris system.

  1. Remove the PJEE-dir directory and all its contents.

    % rm -rf PJEE-dir
    

  2. Restore the PATH or CLASSPATH environment variables to their original values. If these environment variables have been modified during the PJEE installation procedure, their original definitions should be restored.