JavaStation Client Software Guide

Chapter 6 Statically Linking an Application to the JavaOS Image

This chapter describes how to use the Static Linking Kit (SLK) to bind your application to the JavaOS image delivered to JavaStation clients at bootup. The SLK is included in the JavaStation client software.

Static Link Overview

The SLK is a special JavaOS image to which you can link your own application files. When the re-linked JavaOS is delivered to the JavaStation clients, the user application is started automatically.

Using the SLK ensures a faster, simpler boot process and trivial application configuration. The SLK is also required for booting tower model JavaStation computers over a PPP/modem connection.

Using SLK

To use the SLK, you must prepare a directory tree containing JavaOS files and application files and then run the link_javaos utility to create a new JavaOS version incorporating the application files. This procedure is described in the following section.

To Statically Link a Custom Application to the JavaOS Image
  1. Run pkginfo to make sure the required Solaris 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. Untar the file /opt/SUNWjsos/lib/hardware_type.tar in a new working directory.

    The SLK tar files are installed with the JavaStation client software. hardware_type refers to the JavaStation model and can be one of the following:

    Table 6-1 JavaStation Hardware Types


    Hardware Type 

    Brick model 


    Tower model  


    The following example and the remainder of this procedure use JSIIep as the hardware type.

    % mkdir work
    % cd work 
    % tar xvf /opt/SUNWjsos/lib/lib.JSIIep.tar . 

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

    % cd work/lib.JSIIep
    % mkdir classes lib 

  4. 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.

    For example:

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

    Alternatively, you can create symbolic links to the application build area.

  5. Create a file called 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:


    For example:


    For a description of all JavaOS properties, refer to Chapter 4, JavaOS Properties .

  6. Use link_javaos to link your application to the JavaOS image.

    Usage for link_javaos is as follows.

    ./link_javaos [-sun | -gnu] 


In some cases this step can take a very long time, up to 20 minutes.

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

Table 6-2 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: Linking "JavaOS" requires Solaris 2.5 or 2.6

Verifies 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 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.

Verifies the available Java compiler is version 1.1 or later 

If it is not available, the following message is displayed.  

Error: Java version 1.1 or greater is required

Verifies the file exists

If not found, the following message is displayed:  

Error: './lib/' was not found.

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

Creates resource ROM files 

No specific printed errors. 

Creates application mclass

No specific printed errors. 

Creates ROM versions of all classes 

No specific printed errors. 

Adds new ROM data to archive 

No specific printed errors. 

Links javaos binary file

If the following message appears: 

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

it probably indicates unresolved external references from missing libraries to missing Java classes.  

Compresses javaos binary file

If the compression succeeds, the following message is displayed: 

...Compressed "javaos" successfully created.

If the compression fails, the following message is displayed: 

...*Uncompressed* "javaos" created.

Unable to produce compressed "javaos" image.

Note: While your JavaStation may be able to boot with `javaos', it may not be suitable for loading into flash memory.

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 JavaStation computers during the boot sequence as described in Chapter 2, JavaStation Boot Process: Theory of Operations .

Below is an example of output from a successful link_javaos build.

$ link_javaos

(1) Verifying SLK build environment  ...
Building with Solaris tools (as/ld/ar) ...
Statically linking "JavaOS" on a 2.5 system ...

(2) Creating resource ROM files ...
Creating "classes.ROM.o" ...
Creating "others.ROM.o" ...

(3) Creating application 'mclass' ...

(4) ROMizing all classes ...

(5) Assembling ROMizer output ...

(6) Adding the new ROMizer data to archive ...

(7) Linking "./javaos" binary ...

(8) Compressing "./javaos" binary ...

(9) ... Compressed "./javaos" successfully created.