Running Java Programs


Java programs can run on the PJEE on either Microsoft Windows 95/NT or Solaris. Each implementation has a set of invocation tools for running Java software:

Invocation ToolDescription
pjava
pjavaw
Optimized version. The PersonalJava application launcher loads and excutes Java applications.
pjava_g
pjavaw_g
Debug version.
pappletviewer Optimized version. The PersonalJava applet viewer loads HTML pages that contain Java applets.
pappletviewer_g Debug version.

pjava_g and pappletviewer_g include symbol tables for debugging.

Microsoft Windows 95/NT

The PJEE includes a set of invocation tools for launching Java applications and loading HTML files that contain Java applets. Running Java software on the PJEE is based on using one of these invocation tools with command line options that identify the Java software and control various runtime options.

pjava

Here is an example of how to use pjava to launch a Java application and run it on the PJEE:

C:\> pjava HelloWorld

Note: The PJEE-dir\bin directory must be in the PATH environment variable. See PATH for a description of how to modify the PATH environment variable.

This example loads a class file named HelloWorld.class in the current directory. Note that the .class suffix is omitted from the command line. The PersonalJava application launcher locates and executes the main method in the HelloWorld class which then runs the application. If HelloWorld has a GUI, the PJEE creates a window for displaying it.

pjavaw

The pjavaw command is identical to pjava, except that pjavaw does not create a console window for displaying a standard output stream. Here's how to launch a Java application with pjavaw:

  1. Choose the Run command from the Start menu.

  2. Enter the full path name of the pjavaw executable or use the Browse button to find the executable.

  3. Enter the file name for the main application class and any other command line arguments.

  4. Press the Ok button.

The PJEE will then launch the application. The behaviour is identical to the pjava command with the exception that it does not create or use a console window.

pappletviewer

pappletviewer is a test program for loading Java applets. It read an HTML file, parses the first <APPLET> tag while ignoring all other HTML tags, and then loads and executes the corresponding applet.

Here is an example,

C:\> pappletviewer HelloWorldApplet.html

Note: The PJEE-dir\bin directory must be in the PATH environment variable. See PATH for a description of how to modify the PATH environment variable.

Solaris

The PJEE includes a set of invocation tools for launching Java applications and loading HTML files that contain Java applets. Running Java software on the PJEE is based on using one of these invocation tools with command line options that identify the Java software and control various runtime options.

pjava

Here is an example of how to use pjava to launch a Java application and run it on the PJEE:

% pjava HelloWorld

Note: The PJEE-dir/bin directory must be in the PATH environment variable. See PATH for a description of how to modify the PATH environment variable.

This example loads a class file in the current directory named HelloWorld.class. Note that the .class suffix is omitted from the command line. The PersonalJava application launcher locates and executes the main method in the HelloWorld class which then runs the application. If HelloWorld has a GUI, the PJEE creates a window for displaying it.

pappletviewer

pappletviewer is a test program for loading Java applets. It read an HTML file, parses the first <APPLET> tag while ignoring all other HTML tags, and then loads and executes the corresponding applet.

Here is an example,

% pappletviewer HelloWorldApplet.html

Note: The PJEE-dir/bin directory must be in the PATH environment variable. See PATH for a description of how to modify the PATH environment variable.

System Properties

The PJEE uses two standard mechanisms for specifying system options:

Java application software can also provide user-level options that are based on Java properties and Java property files.

Standard System Properties

The table below describes standard Java system properties that are part of the JDK 1.1.x API.

PropertyTypeDescription
file.encoding string The system locale's character encoding. See Supported Encodings in JDK 1.1 Internationalization Overview.
file.encoding.pkg string The package that contains the classes for converting between the system locale's character encoding and Unicode.
file.separator string
Microsoft Windows 95/NT     \
Solaris     /
Platform-dependent name separator used in path names.
java.class.path string Java class path in platform-dependent form.
java.compiler string Specifies a JIT compiler to use.
java.class.version string Java class file version number.
java.home string PJEE installation directory.
java.vendor string PJEE vendor-specific string.
java.vendor.url string PJEE vendor URL.
java.version string Version number of PJAE specification.
line.separator string
Microsoft Windows 95/NT     \r\n
Solaris     \n
Platform-dependent line separator used in text files.
os.arch string Host OS architecture.
os.name string Host OS name.
os.version string Host OS version.
path.separator string
Microsoft Windows 95/NT     ;
Solaris     :
Platform-dependent name separator used in search paths.
user.dir string User's current working directory.
user.home string User's home directory.
user.language string ISO 639 language code of the system locale.
user.name string User's account name.
user.region string ISO 3166 country code of the system locale.
user.timezone string The POSIX.1 time zone name.

PJEE-Specific System Properties

The table below describes PJEE-specific system properties.

Note: These PJEE-specific system properties are for diagnostic purposes only. They should not be used in production versions of Java programs.

PropertyTypeDefaultDescription
awt.toolkit reference sun.awt.touchable.TouchableToolkit Use an alternate implementation of the AWT toolkit.
sun.awt.platform.pixelType string color:8 Set the color model and depth.
sun.awt.aw.DefaultCursor reference sun.awt.aw.Touchable.FingerPrint Specify the class used for the cursor. A value of "blank" disables the cursor.
sun.awt.im.InputMethod reference null Enable the named input method. A value of "default" expands to sun.awt.otk.SampleInputMethod.
sun.awt.im.Japanese boolean false If true, then use a Japanese Kana keyboard instead of a QWERTY keyboard.
sun.awt.im.NoVirtualKeyboard boolean false If true, then specify that a physical keyboard is present and disable the virtual keyboard.
sun.awt.otk.noRandomSelectionMode boolean true If true, then disable text cursor behaviour when the user makes a selection away from a text component.
sun.awt.otk.ObjectToolkit reference sun.awt.otk.ObjectToolkit Use an alternate implementation of the Truffle Object Toolkit.
sun.awt.otk.textWordSelectionOff boolean false If true, then disable word selection mode for mousePressed with text components.
sun.awt.palette string Orange Specify the name of the selected palette in the palette database.
sun.awt.palette.definitions string PJEE-dir/lib/touchable.palettes Specify the path name of the palette database.
sun.awt.touchable.doNotDrawFocusRectangle boolean false If true, then disable the focus rectangle.
sun.awt.touchable.paletteClass reference sun.awt.otk.ColorPalette Spcify the name of color palette hashtable.
sun.awt.touchable.sound boolean false If true, then enable sound.
sun.graphicssystem reference sun.awt.aw.GraphicsSystem Use an alternate implementation of the Truffle graphics system.
sun.graphicssystem.height integer 480 Set the height of the window containing the graphics system.
sun.graphicssystem.width integer 640 Set the width of the window containing the graphics system.
sun.windowsystem reference sun.awt.aw.WindowSystem Use an alternate implementation of the Truffle window system.

System Property Example

The pjava command uses the -D command line option to specify the value of a system property. For example,

% pjava -Dsun.awt.palette=Sand HelloWorld

Troubleshooting

Here are some troubleshooting tips for running the PJEE.