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:
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.
This section explains how to load and unload 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.
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.
This section contains the following procedures:
To start the NetWare GUI, enter startx at the system console.
When the
button appears on the taskbar in the lower left corner, the startup process is complete.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
icon on the Server GUI taskbar, or click > , .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
> .All instances following the active screen have an asterisk in front of the screen name.
To toggle to the next screen, press Alt+Esc.
To toggle to the NetWare screen selection list, press Ctrl+Esc.
There are three methods to activate the taskbar:
Click
in the lower left corner of the Server GUI screenPress the Windows meta key
Right-click on the NetWare GUI background
The taskbar consists of items that are either menus or commands.
Menus consist of the following items:
Default name
International name (optional)
If you specify an international name, it appears in the taskbar; otherwise, the default name appears.
Internationalized names are stored in files with the .properties extension.
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 the actual commands to execute.
Click
in the NetWare GUI, select , then select .Right-click the location where you want to install the menu item.
Click either
or .Type the information in the Edit panel.
On the taskbar, click
, then click .Click
in the NetWare GUI, select , then select .Click the menu you want to change.
Modify the command information in the Edit panel.
On the taskbar, click
, then click .Click
in the NetWare GUI, select , then select .Right-click the menu you want to remove.
Select
.On the taskbar, click
, then click .Click
in the NetWare GUI, select , then select .Right-click the menu you want to move.
Click either
or .On the taskbar, click
, then click .If a target menu is open, the selected menu moves into that menu; otherwise, the selected menu moves past the target menu.
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.
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, MyApp.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 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.
You use the NetWare GUI Environment utility to configure 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.
In the NetWare GUI, click
, select , then select .See the NetWare GUI Environment online help for further documentation on using this utility.
In the NetWare GUI, click
, select , then select .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.
Select the desired background pattern and click
.Click
.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
The following table shows the keystroke actions for Java text areas and text fields as implemented for NJVM.
Table 5-12 Keystroke actions
There are three ways to shut down the NetWare GUI:
In the NetWare GUI, click
, select , then click .Press Ctrl+Alt+Backspace.
Run stopx from the System Console prompt.
This section contains the following processes:
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, assume that an applet called MYAPP and its corresponding HTML file are found in sys:\myapps\. To run this applet, you would enter
appletviewer sys:\myapps\myapp.html
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.
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.
To display a list of currently running processes and their process IDs, enter the following at the system console:
java -show
Get a list of the running Java processes. At the System Console prompt, enter
java -show
At the System Console prompt, enter
java -shutdownprocess_ID
For example:
java -shutdown610
610 is the ID of the process to be shut down.
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.
You can use the file browser to accomplish the following:
You can search for files by name or search for specific text within a file. You can start from the file search taskbar, the GUI Start menu, or within the file browser.
After you start the file searching application, do the following to search for files:
Right-click the folder you want to search for files in.
Specify the initial folder to start the file browser from.
Select the Search item from the pop-up menu.
When the file searching application displays, type the name of the file or the specific text you are searching for.
You can include the * and ? wildcards.
You can also specify additional search criteria.
The file searching text is not case sensitive.
Click
.The file browser supports file associations that specify a default action to occur when a file is selected. You can specify which application to use for opening files that use a specific extension.
The File Associations dialog box contains two columns. One column specifies the file extension. The other column contains the command to execute. When you specify the command to execute, the %1 functions as a placeholder for the full path of the file. When the File Browser runs the associated command, it replaces the %1 with the full pathname of the selected file.
In the File Browser menu, click
> .In the File Associations dialog box, add, edit, or delete associations.
For example:
Extension |
Command |
Explanation |
---|---|---|
nlm |
load %1 |
Loads the NLM program. |
ncf |
%1 |
Runs the .ncf file. |
txt |
editor %1 |
Opens the .txt file in the GUI editor. |
cfg |
editor %1 |
Opens the .cfg file in the GUI editor. |
The extension entries are not case sensitive.
Click
.This section contains the following processes:
Start NJVM by entering the following at the System Console prompt:
load java
At the System Console prompt, enter
envset
When you unload NJVM (java.nlm), the process deletes the environment variables that were set using ENVSET.
The DISPLAY environment variable exists in two environments: the environment for Java and the C Library environment. Graphical Java applications use the DISPLAY variable from the environment for Java. All other applications, including the NetWare GUI, use the Display variable from the C Library environment.
It is helpful to understand the UNIX X Window System* before setting up the DISPLAY environment variable.
To set the DISPLAY variable in the environment for Java:
Start NJVM by entering the following at the System Console prompt:
load java
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.
To set the DISPLAY variable in the C Library environment:
At the System Console prompt, enter
env DISPLAY=IP_address:display
When the NJVM loads, the environment for Java inherits the value of the DISPLAY variable in the C Library environment.
The default value for IP_address:display is 127.0.0.1:0.0. This is the address of the loopback interface, which displays the output to the local server.
To make the application always open to the NetWare GUI screen, enter the following at the System Console prompt,
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.
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.
The remote display feature lets you display the output 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.
This section describes how to use the remote display feature when both the X client and the X server are NetWare servers. This procedure is similar for other platforms; however, you need to refer to the platform-specific documentation for setup instructions.
The two machines used for the remote display feature are called the remote server and the local server The remoter server is the X client machine. The local server is the X server that displays the application that is running on the X client.
You must configure your local X server to allow remote access. There are two methods to authorize access of a remote X client to a local X server:
Method 1:
Edit the java\nwfgx\bin\xservrc file to change the load Xvesa command to load Xvesa -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.
Method 2:
Start X server, then run xhost +IP_address_of_Xclent on the local system.
For example, xhost +10.0.0.3
This lets you add hosts to the list of X client workstations that you allow to access your X server. It also lets you delete workstations from this list.
Allow the remote NetWare system to access the local X server.
Start X server at the local system.
At the local system, start RCONJ and log in to the NetWare server.
Do the following in the RCONJ window:
Start NJVM by entering the following at the System Console prompt:
load java
Enter the following:
envset display=ip_address_of_local_X_server:0
Start the Java applet or application.
(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.
NJVM uses an environment variable to simulate a current working directory. This variable, CWD, lets you run an application in any directory as if it is the current working directory. By default, this variable is set to the root (\) when Java is loaded. In NetWare, Java’s root is sys:\.
The preferred method of using CWD is to set it for only the current application by using the -env option. For example:
java -envCWD=sys:\myfiles myapp
To set the CWD for all applications:
Start NJVM by entering the following at the System Console prompt:
load java
Set the variable by entering:
envset CWD=pathname
For example:
envset CWD=sys:\myjava\myapp
Setting the CWD does not change the CWD of applications that are currently running.
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.
The preferred method of changing the CLASSPATH is to set it for only the current application by using the -classpath option.
java -classpath=$CLASSPATH;sys:\myclasses myapp
To change the CLASSPATH for all applications:
Start NJVM by entering the following at the System Console prompt:
load java
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.
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
This section explains the following components:
java.cfg configuration file
autoexec.ncf
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.
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.
This section explains the following NJVM internationalization issues.
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).
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.
NJVM 1.4.2 includes two implementations of the HotSpot virtual machine (VM). This section explains the applications for each version.
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
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.
On NetWare you can run applications with either the Client VM or the Server VM. However, 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.
To determine which version of the VM is running, enter the following command at the System Console prompt after an application has been started:
modules jvm
If the jvm.nlm program was loaded from sys:\java\bin\client, the Client VM is running. If the jvm.nlm program was loaded from sys:\java\bin\server, the server version is running.
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.