5.7 Using the Novell JVM (NJVM) for NetWare on the Server

This section explains the types of administrative tasks that you can do with NJVM.

Additional information you might need about the JVM for NetWare can be located in the Novell JVM for NetWare documentation.

For information about using and managing Java-based components on the NetWare server, see:

5.7.1 Font.properties File

The java\lib\font.properties file for NJVM controls the Java font to native font mapping. The font.properties file is nearly identical to the Solaris* implementation. For a description, see the font.properties documentation on the Sun Web Site.

5.7.2 Loading and Unloading NJVM

This section explains how to load and unload NJVM.

Loading NJVM

To load NJVM (java.nlm), enter load java at the system console.

This loads NJVM into memory and allows the command interpreter to recognize when a Java application or applet is launched. For information about different loading options, see JVM Client and Server Versions.

Unloading NJVM

You can unload NJVM (java.nlm) from memory by entering the following command at the system console:

java -exit

This calls any registered shutdown hooks, closes all of your Java applications, and unloads Java.

5.7.3 NetWare GUI Tasks

This section contains the following procedures:

Starting the NetWare GUI

To start the NetWare GUI, enter startx at the system console.

When the Novell button appears on the taskbar menu in the lower left corner, the startup process is complete.

Server Console Utility

The NetWare GUI’s Server Console utility is C-based and does not require Java to be loaded. Multiple instances of the Server Console utility can be loaded. This lets you view multiple server screens simultaneously in the NetWare GUI. For example, you can view the Logger screen, Edit screen, and the Console screen from three different windows.

To start the Server Console utility, click the Server Console icon on the Server GUI taskbar menu, or click Novell > Utilities, Server Console.

NOTE:Some screens have limited functionality and update only when they are the active screen. You need to view these screens from within a system console that follows the active screen.

The first instance of the Server Console utility you launch follows the active screen. This means that it immediately reflects changes made on the active screen. For all other instances, following the active screen is not the default setting; you can manually select this option by clicking View > Follow Active Screen.

All instances following the active screen have an asterisk in front of the screen name.

Toggling between the NetWare GUI and the System Console

  • To toggle to the next screen, press Alt+Esc.
  • To toggle to the NetWare screen selection list, press Ctrl+Esc.

Activating the Taskbar Menu

There are three methods to activate the taskbar menu:

  • Click Novell in the lower left corner of the Server GUI screen
  • Press the Windows meta key
  • Right-click on the NetWare GUI background

Configuring the Taskbar Menu

The taskbar menu consists of items that are either menus or commands.

Menus

Menus consist of the following items:

  • Default name
  • International name (optional)

If you specify an international name, it appears in the taskbar menu; otherwise, the default name appears.

Internationalized names are stored in files with the .properties extension.

Commands

Commands consist of the following items:

  • Default name
  • International name
  • The command to execute

    IMPORTANT:We recommend that you specify a .ncf file that contains actual commands to execute.

Creating a Menu

  1. Click Novell in the NetWare GUI, select Settings, then select Menu Editor.

  2. Right-click the location where you want to install the menu item.

  3. Click either New Command or New Menu.

  4. Type the information in the Edit panel.

  5. On the taskbar menu, click File, then click Save.

Modifying a Menu

  1. Click Novell in the NetWare GUI, select Settings, then select Menu Editor.

  2. Click the menu you want to change.

  3. Modify the command information in the Edit panel.

  4. On the taskbar menu, click File, then click Save.

Deleting a Menu

  1. Click Novell in the NetWare GUI, select Settings, then select Menu Editor.

  2. Right-click the menu you want to remove.

  3. Select Remove.

  4. On the taskbar menu, click File, then click Save.

Moving a Menu

  1. Click Novell in the NetWare GUI, select Settings, then select Menu Editor.

  2. Right-click the menu you want to move.

  3. Click either Move Up or Move Down.

  4. On the taskbar menu, click File, then click Save.

    If a target menu is open, the selected menu moves into that menu; otherwise, the selected menu moves past the target menu.

Using International Names

The Menu Editor contains two sections for names:

  • Default Name: The name that displays for the menu item’s text if no international name is specified.
  • Optional International Name: The name that displays if an international name is specified. The text for the international name is specified in the properties file.

Properties File

A properties file is a text file that contains key=value entries. For example, PROGRAMS=programs or UTILITIES=utilities.

The key on the left should contain only ASCII characters. The value on the right can contain characters or specifiers for Unicode encoding. For example, you can specify the value Run using any of the following:

  • RUNITEM=Run
  • RUNITEM=\u0052\u0075\u006e
  • RUNITEM=R\u0075\n

The naming convention is to specify a file with a base name and an extension of .properties. For example, MyNames.properties

To use a properties file, you must first place it in the sys:\java\lib\taskbar directory. Then, in the Optional Internationalized Name section of the Menu Editor, click Browse to select your properties file. When you select this file, the items in the file display in a list of names. You choose the name you want to use from this list.

IMPORTANT:Do not add your own name entries to the NWMenu.properties file. This file is overwritten when you install a newer version of NJVM.

The values you retrieve from a properties file can correspond to the language of the server. If you provide the product for an international audience, you might want to ship properties files for each of the locales supported by the server. To do this, create a file whose name will be used as the base name. Then create files with filenames that contain the base name plus a language (and optionally locale) specifier that corresponds to the language of the values in the properties file. This follows the naming convention used by Java properties files.

For example, the following are some of the file names in the sys:\java\lib\taskbar:

  • NWMenu.properties contains values for English text.
  • NWMenu_de.properties contains values for German text.
  • NWMenu_fr.properties contains values for French text.
  • NWMenu_ru.properties contains values for Russian text.

When you specify the properties file, you specify the default properties file such as NWMenu.properties. The actual properties file that is used to retrieve the names depends on the language and locale of the server. For example, if the NWMenu.properties file is specified, the server language is set to use German, and there is a NWMenu_de.properties file, then the NWMenu_de.properties file is searched first for the entry. If the entry is not found in this file, then the NWMenu.properties file is searched. If the entry is not found in either file, then the default name is used.

Configuring X Server Using the NetWare GUI Environment Utility

You use the NetWare GUI environment utility to configure VESA Super VGA and Accelerated-X Servers on NetWare. This utility lets you select the video board, keyboard, mouse, and monitor from a set of predefined hardware devices supported by the NetWare GUI environment utility.

  1. In the NetWare GUI, click Novell, select Settings, then select GUI Environment.

See the NetWare GUI Environment online help for further documentation on using this utility.

Configuring Your System for an Accelerated Video Driver

To achieve the best video quality when you configure your accelerated video driver, configure the monitor and select a refresh rate as high as possible.

NOTE:When selecting a video driver, we recommend using the standard Xvesa driver.

  1. In the NetWare GUI, click Novell, select Settings, then select GUI Environment.

  2. Select your video board from the Video Board List.

    This activates the Monitor tab. The default settings are Super VGA with 1024 x 768 resolution and the Monitor tab deactivated.

  3. Select your monitor from the list of monitors.

    This enables all possible refresh rates for the selected monitor.

  4. Select the highest available refresh rate, then set the video board to the desired resolution.

  5. Select Test, then click OK.

  6. After the test pattern displays, click OK, click Yes, then click Yes again.

Selecting a Background Pattern

  1. In the NetWare GUI, click Novell, select Tools, then select Backgrounds.

    All files in the sys:\java\nwgfx\pixmaps directory display. The supported graphics formats are xpm, jpeg, gif, and bmp. If you have background patterns (in the supported formats) that you want to use, place them in the sys:\java\nwgfx\pixmaps directory.

  2. Select the desired background pattern and click Test.

  3. Click OK.

Using the NetWare GUI without a Mouse

If you start the NetWare GUI without a mouse attached to a PS/2 or USB port, the NetWare GUI will start in mouseless mode.

When the NetWare GUI is operating in mouseless mode, use the keypad keys for mouse movement and button clicks.

IMPORTANT:NUMLOCK must be activated to enable keypad mouse movements.

Table 5-11 Keystrokes for Using the NetWare GUI without a Mouse

Keypad Key

Function

Arrows

Move the mouse pointer.

Shift+arrows

Accelerate pointer movement.

5

Behaves like the default pointer button.

0

Locks the default pointer button down (for easy dragging).

. (decimal)

Unlocks the default pointer button (releases a drag).

+ (plus)

Double-clicks the default pointer button.

Alt+Tab

Switches to the next program.

Alt+Shift+Tab

Switches to the previous program.

Keystroke Actions for Java Text Areas and Text Fields

The following table shows the keystroke actions for Java text areas and text fields as implemented for NJVM.

Table 5-12 Keystroke actions

Action

Text Area

Text Field

Navigate out forward

Ctrl+Tab

Tab

Navigate out backward

Ctrl+Shift+Tab

Shift+Tab

Move up/down one line

Up-arrow, Down-arrow

N/A

Move to previous/next character

Left-arrow, Right-arrow

Left, Right

Move to previous/next word

Ctrl+Left-arrow, Ctrl+Right-arrow

Ctrl+Left, Ctrl+Right

Move to start/end of line

Home, End

Home/End

Move to start/end of text area

Ctrl+Home, Ctrl+End

N/A

Move up/down a page

PgUp, PgDn

N/A

Select all

Ctrl+/

Ctrl+/

Deselect all

Ctrl+\

Ctrl+\

Extend selection up/down

Shift+Up-arrow, Shift+Down-arrow

N/A

Extend selection left/right

Shift+Left-arrow, Shift+Right- arrow

Shift+Left, Shift+Right

Extend selection to start/end of line

Shift+Home, Shift+End

Shift+Home, Shift+End

Extend selection to previous/next word

Ctrl+Shift+Left-arrow, Ctrl+Shift+Right-arrow

Ctrl+Shift+Left, Ctrl+Shift+Right

Extend selection to start/end of text area

Ctrl+Shift+Home, Ctrl+Shift+End

N/A

Extend up a page

Shift+PgUp

N/A

Extend down a page

Shift+PgDn

N/A

Copy selection

Ctrl+C

Ctrl+C

Cut selection

Ctrl+X

Ctrl+X

Paste

Ctrl+V

Ctrl+V

Delete next character

Delete

Delete

Delete previous character

Backspace

Backspace

Insert tab

Tab

N/A

Toggle Insert/Replace mode

Insert

Insert

Insert line break

Enter

N/A

Submit entry

N/A

Enter

Closing the NetWare GUI

There are three ways to shut down the NetWare GUI:

  • In the NetWare GUI, click Novell, select Close GUI, then click Yes.
  • Press Ctrl+Alt+Backspace.
  • Run stopx from the System Console prompt.

5.7.4 Applet and Application Tasks

This section contains the following processes:

Running an Applet

  • To run an applet, enter

    appletviewer html_filename or URL

  • To run an applet sending any console output to a new screen, enter

    applet -J-ns html_filename or URL

For example, suppose an applet called MYAPP and its corresponding HTML file are found in sys:\myapps\. To run this applet, you would enter applet sys:\myapps\myapp.html.

Running an Application

  • To run an application, enter

    java application_name

  • To run the application in a new screen, enter

    java -ns application_name

NJVM assigns a screen to the application, then executes the application. If the application requires a graphical interface, NJVM loads the NetWare GUI and displays the application.

IMPORTANT:If the application requires console keyboard input, the -ns option must be used.

While the application is running, you can use the Server Console utility to view any output on the console screens. For instructions on using the Server Console utility, see Server Console Utility.

All GUI applications appear in the same GUI screen.

Binding an Application to a Specific Processor

To force an application to run on a specific processor, use the -mp flag. The processor number should follow -mp. For example, to assign a JVM specifically to processor 3, enter the following at the System Console prompt:

java -mp3 application_name

To assign a JVM to processor 0, enter the following at the System Console prompt:

java -mp0 application_name

NOTE:Using the -mp0 flag is equivalent to disabling multiprocessor support. This flag should be used only with applications that are considered mp-unsafe.

Listing the Current Java Processes

To display a list of currently running processes and their process IDs, enter the following at the system console:

java -show

Shutting Down a Running Java Process

  1. Get a list of the running Java processes. At the System Console prompt, enter

    java -show

  2. At the System Console prompt, enter

    java -shutdownprocess_ID

    For example:

    java -shutdown610

    610 is the ID of the process to be shut down.

  3. To shut down all running processes, enter the following at the System Console prompt:

    java -shutdownall

NOTE:When you use -shutdown, Java calls the application’s registered shutdown hooks. This provides a more graceful shutdown than the Java -kill command, which closes the application without calling the application’s shutdown hooks. It is the application’s responsibility to register its shutdown hooks.

5.7.5 Viewing and Setting Environment Variables

This section contains the following processes:

Viewing the Current Values of Environment Variables

  1. Start NJVM by entering the following at the System Console prompt:

    load java

  2. At the System Console prompt, enter

    envset

When you unload NJVM (java.nlm), the process deletes the Environment variables that were set using ENVSET. You can add Environment variables in the sys:\etc\java.cfg file, which is read when Java loads.

Setting the DISPLAY Environment Variable

It is helpful to understand the UNIX X Window System* before setting up the DISPLAY environment variable.

  1. Start NJVM by entering the following at the System Console prompt:

    load java

  2. At the System Console prompt, enter

    envset DISPLAY=IP_address:display

    The default value for display is 127.0.0.1:0.0, which is the address of the loopback interface and the default value for the display and screen you want to use.

Using the Remote Display Feature

The Remote Variable Display feature lets you export the display of any X client programs to any machine on the network running an X server. Because the NetWare GUI is X-based, all Java GUI applications and applets are considered X clients and are able to use the remote display feature.

Allowing Remote Access to a Server

You must configure your destination server to allow remote access. There are two methods to authorize access of a remote X client to a local X server:

  • At the X Server console prompt, enter

    -ac

    This turns off access control and lets any other client access the server. Be cautious with this method. It lets anyone who can connect to your X server run programs on your display.

  • Run xhost on the local system.

    This lets you add hosts to the list of client workstations that you allow to access your server. It also lets you delete workstations from this list. For more information on determining the best method of allowing remote access, see your X server user manual.

Displaying a Java Applet or Application on a Local X Server
  1. Allow the remote NetWare system to access the local X server.

    See Allowing Remote Access to a Server.

  2. Start X server at the local system.

  3. At the local system, start RCONJ and log in to the NetWare server.

  4. Do the following in the RCONJ window:

    1. Start NJVM by entering the following at the System Console prompt:

      load java

    2. Enter the following:

      envset display=ip_address_of_local_X_server:0

    3. Start the Java applet or application.

  5. (Optional) To make the application always open to the NetWare GUI screen, enter the following at the command line of the NetWare server:

    envset display=ip_address_of_local_X_server:0.0

    All Java GUI applications now display on the remote client workstation on the NetWare GUI screen. If you do not want the application to always open to the NetWare GUI screen, remove the “.0” from the end of the IP address.

    NOTE:The local System Console screen does not automatically switch to the NetWare GUI screen when a GUI application is opened from a remote server or from foreign IP addresses. You must manually switch to the NetWare GUI on your local server to see the display being exported from the remote server.

Setting the CWD Environment Variable

You can use the Current Working Directory (CWD) variable to run an application in a specific directory even if it is not part of a package. The CWD variable is set to the root when Java is loaded; however, you can set it to any desired directory.

  1. Start NJVM by entering the following at the System Console prompt:

    load java

  2. To set the CWD for all applications, enter the following at the System Console prompt:

    envset CWD=pathname

    For example:

    envset CWD=sys:\myjava\myapp

    The preferred method is to set the CWD for the current application by using the -env option. For example:

    java -envCWD=sys:\myfiles myapp

Setting the CLASSPATH Environment Variable

A default CLASSPATH variable is set when Java loads. If the CLASSPATH variable is set incorrectly, your Java applications might not run. A lengthy CLASSPATH variable might decrease the performance of your Java applications.

  1. Start NJVM by entering the following at the System Console prompt:

    load java

  2. Enter the following at the System Console prompt:

    envset CLASSPATH=$CLASSPATH;path_to_append

    For example, to append the path sys:\myclasses to the current CLASSPATH, enter

    envset CLASSPATH=$CLASSPATH;sys:\myclasses

    The $ symbol in $CLASSPATH allows the substitution of the current value of the CLASSPATH environment variable.

NOTE:The default CLASSPATH variable includes (.), which means to look in the current working directory (CWD) for the application. If the CWD variable is not set correctly, the application might not run. For more information, see Setting the CWD Environment Variable.

5.7.6 Performance Tuning

The default native (C) stack size for Java threads on NetWare is 160 KB. For applications that create many threads and do not require such a large stack size, the -Xss Java command options can be used to specify the stack size. For an explanation of the Java command options, refer to the JavaSoft documentation for the Java Interpreter.

To specify the amount of virtual memory available to Java applications for non-heap allocations, use the -vm Java command option. The default is 64 MB for NetWare 6 and 100 MB for NetWare 6.5. The -vm Java command option is unique to NetWare and is not supported by JavaSoft. The following is the syntax for this option:

java -vmsize MyClass

For example,

java -vm128m MyClass

5.7.7 Java Configuration Files

This section explains the following components:

  • java.cfg configuration file
  • autoexec.ncf

Java.cfg Configuration File

The java.cfg file is an optional configuration file that can be used to set Environment variables. It is located in the sys:\etc directory and is read when java.nlm is loaded.

Autoexec.ncf

The following lines are added to the sys:system\autoexec.ncf file during the installation. If they are not added, you can add them manually right after the “mount all” command in the file.

SEARCH ADD SYS:\JAVA\BIN SEARCH ADD SYS:\JAVA\NWGFX\BIN STARTX

HINT:The STARTX line is optional and should go at the end of the autoexec.ncf file. It causes the NetWare GUI to begin running at server startup. You should delete any other instances of these lines in the autoexec.ncf file.

5.7.8 Internationalization

This section explains the following NJVM internationalization issues.

Russian Keyboard Activation

If your server is not installed as a Russian server, you must enable the Russian keyboard. To enable the Russian keyboard, select it in the NetWare GUI setup utility. The Russian keyboard toggles between standard and Russian characters in the same manner as done by keyb.nlm. The keyboard mode on startup uses standard characters. To toggle between modes, press the left and right shift keys simultaneously.

AWT Limitations

Dead keys are not supported in AWT components.

AWT components can display characters only from the current locale.

AWT components cannot display Japanese, Chinese, or Korean characters.

Keyboard entry of Russian characters in AWT components is available only if the current server language is Russian (language 13).

Adding Fonts with Font.properties.allfonts

The font.properties file with no extension is the default file for Latin character languages. Files with country-specific extensions are provided for Russian, Japanese, Chinese, and Korean servers. For example, font.properties.ru corresponds to the Russian font.properties file. No configuration is necessary beyond setting the server language during installation because NJVM automatically selects the appropriate font.properties file for the language setting. However, some servers might require systems or other resources located on different language platforms. To enable full character support, back up the font.properties file, then rename the provided file font.properties.allfonts to font.properties.

NOTE:Renaming font.properties.allfonts to font.properties slows the startup of the first application because of the additional characters that need to load.

5.7.9 JVM Client and Server Versions

NJVM 1.4.2 includes two implementations of the HotSpot virtual machine (VM). This section explains the applications for each version.

Client VM

The Client VM is the default version of the HotSpot runtime compiler. It is specifically tuned to reduce application startup time and memory footprint.

The Client VM is located in sys:\java\bin\client\jvm.nlm

Server VM

The Server VM is specifically tuned to maximize peak operating speed. It is intended for long running server applications. The server version requires a larger memory footprint to execute a Java application than that of the client version. You might use this version when operating speed is more important than startup time.

The Server VM is located in sys:\java\bin\server\jvm.nlm.

Switching JVM Versions

On NetWare you can run applications with either the Client VM or the Server VM. You cannot use both simultaneously. The command-line flags used to specify which VM to load are -client and -server. You cannot switch VMs while Java applications are running. If you attempt to start an application using one of these flags and the VM version requested is different than what is already being used, then that Java application will fail to load.

The default version of the JVM is the Client VM. To change the default VM to server, add the following line to the sys:\etc\java.cfg file:

JAVA_COMPILER=server

Running an application with the Server VM might require more heap space than with the Client VM. To increase the heap size, use the -Xmxheapsizem flag. For example, you might have a Java application that requires 128 MB of heap to run with the client JVM. Changing to the server might require more heap space, so you could set the heap size flag to -Xmx256m.