Netra j 2.0.1 Product Notes

Requirements

Running the SLK requires the following Solaris packages:

To Statically Link a Custom Application to JavaOS
  1. Run pkginfo to make sure the required packages are installed on your Solaris system:


    % pkginfo SUNWarc SUNWbtool SUNWcsu SUNWlibm SUNWsprot SUNWtoo 
    system SUNWarc 								Archive Libraries 
    system SUNWbtool 								CCS tools bundled with SunOS 												
    system SUNWcsu 								Core Solaris, (Usr)
    system SUNWlibm 								Sun WorkShop Bundled libm 
    system SUNWsprot 								Solaris Bundled tools 												
    system SUNWtoo 								Programming Tools 												

    If these packages are not available, install them from your Solaris CD-ROM or contact a Sun sales representative.

  2. Obtain the SLK tar file lib.JSIIep.tar from http://www.sun.com/javasystems/slk .

    Instructions for downloading the SLK tar file are provided on the SLK download page.

  3. Untar lib.JSIIep.tar in a new working directory.

    For example:


    % mkdir work
    % cd work 
    % cp download_directory/lib.JSIIep.tar .
    % tar xvf lib.JSIIep.tar
    

  4. Create the directories classes and lib under the directory work/lib.JSIIep.


    % cd work/lib.JSIIep
    % mkdir classes lib 
    

  5. Copy your application class files and other required resources to the classes and lib directories.

    Copy all CLASSPATH-loadable files to the classes directory and all non-class files to the lib directory, or create symbolic links to the application build area.

    For example:


    % cp -r CLASSPATH_loadable_files classes/.
    % cp -r non_class_files lib/.
    

  6. Create a file called javaos.properties in the lib directory that contains JavaOS properties and other properties to be set before the application executes.

    At minimum, this file should include the property javaos.mainProgram, which points to the class containing the main entry point of your application. This property is set as follows:


    javaos.mainProgram=main_class
    

    For example:


    javaos.mainProgram=Orion.main

    For a description of all JavaOS properties, refer to the Netra j 2.0 Administrator's Guide.

  7. Use link_javaos to link your application to the JavaOS binary.

    Usage for link_javaos is as follows.


    ./link_javaos [-sun | -gnu] 
    

    where:

    • -sun (default) uses the Solaris assembler/linker tools found in /usr/ccs/bin

    • -gnu uses GNU tools, which must be installed in /opt/gnu

    The linking takes between 5 and 20 minutes, depending on the size of your custom application and the speed of your machine.

    The link_javaos utility does several verifications and then builds a new javaos binary that incorporates your application files. The table below shows error messages that may be displayed during each step in the process.

Table 1-3 Error Messages During the link_javaos Process

javaos_link action

Error Messages  

Verifies your host system is running Solaris 2.5 or 2.6 

If your system is running a different version of Solaris, the following message is displayed.  

Error: Building "JavaOS" requires Solaris 2.5 or 2.6

Verifies that the specified tools have been properly installed  

If -sun was selected (or left default) and the required tools directory is not found, the following message is displayed:

Error: The required tools directory (/usr/ccs) was not found

If -gnu was selected and the GNU tools directory is not found, the following message is displayed:

Error: The required tools directory (/opt/gnu) was not found

The GNU tools can be obtained from www.gnu.org. The minimum GNU packages required are binutils, make, and gcc.

Note that the SLK build scripts will always look in /opt/gnu for the GNU tools. Some systems have the GNU compiler and tools installed in the directory /usr/local. On such systems it may be sufficient to add a symbolic link that points /opt/gnu to /usr/local (e.g. ln -s /usr/local /opt/gnu).

Verifies the available Java(TM) compiler is version 1.1 or later 

If not, the following message is displayed.  

Error: Java version 1.1 or greater is required

Verifies the file javaos.properties exists

If not found, the following warning is displayed:  

Warning: './lib/javaos.properties' was not found.

This file is required to specify the javaos.mainProgram property.

Builds a new javaos, linking your application files to the binary

During the build, various warning messages may be 

displayed concerning "impure constant pools," "references to dead strings," etc. These messages can be safely ignored. 

Reports whether the build is successful  

If the build is successful, the following message is displayed: 

(9) ... 'javaos' successfully created

If the build fails, the file javaos is not created and the following message is displayed: 

Error: 'javaos' was not properly created due to previous errors

A successful link_javaos build yields a single compressed javaos file that incorporates your application.

You can now set up javaos to be delivered to JavaStations during the boot sequence as described in the Netra j 2.0 Administrator's Guide.