The build environment Examples logo
Instructions for collecting and installing the proper tools for building these examples.

What you'll need

Here's a list of the things you'll need to build and run these examples.


Name Description
Java(TM) 2 Platform Standard Edition Jini(TM) network technology runs on the Java Platform. Specifically, the new Jini Technology Starter Kit (starter kit) v2.0 release requires version 1.4.1 or later of the Java(TM) 2 Platform Standard Edition [J2SE(TM)]. get Java
Get the software>>>
Jini(TM) Technology Starter Kit These examples are built to work with both v1.2.1 and v2.0 of the starter kit. get Jini
Get the software>>>
Apache Ant Apache Ant is a platform independent build tool written in the Java Programming Language, with build scripts (like Makefile files for make) that use an ASCII/XML form. Common tasks such as compling, creating JAR files, copying files, etc. have associated Ant tasks. The class files, JAR files, API documentation generated by the Javadoc(TM) tool, and other build activities in these examples are all orchestrated through Ant and Ant add-ons.
Note: Ant is only required if you wish to (re)build the examples.
get Ant
Get the software>>>
ClassDepAndJar task Apache Ant provides a means of adding user-defined Ant tasks. This is such a task. The ClassDepAndJar task is used to pull together JAR files based on a set of dependencies. It is essentially a wrapper for the ClassDep tool bundled with the starter kit. A version of ClassDepAndJar is bundled with the examples. No "installation" is necessary. Included with these examples.

Creating an environment in which to run the examples

There are several things that need to be installed in order to use or build these examples, and those items are enumerated above. The following notes cover the UNIX(TM) and Microsoft Windows operating environments.

Running the examples on UNIX

This section will discuss what must be done to run the examples on a typical UNIX platform. For example, these examples should run successfully on

The scripts that start Jini technology-enabled services (Jini services) and applications (Jini applications) are Bourne shell scripts, which generally run well on any UNIX system. Note that there will always be things that must be adjusted from system to system (host names, etc.). Please review the scripts before running them.

The general steps for preparing a computer for running these examples are:

  1. Make the computer network savvy. The name Jini Network Technology strongly suggests that a network is an important part of the environment... and it is. Questions occasionally appear on the various supporting mail lists from users who are having trouble making services work. Some of these problems can be directly traced back to the fact that the computer running the Jini services did not have a properly configured network set up. It is strongly suggested that this step, establishing a solid network configuration, be done before anything else.
  2. Install the Java Programming Language tools. Version 2.0 of the starter kit requires version 1.4.1 or later of J2SE to work properly. All of the examples come pre-built, compiled with this version (or later). While it is possible to compile the examples using an earlier version of Java Technology and run the examples and software from v1.2.1 of the starter kit, it is recommended that the latest version of J2SE be used for all Jini technology development. Be sure the executables associated with this release are included in the execution search path. (That is, typing "java" should start the virtual machine for the Java Programming Language.)
  3. Install v2.0 of the Jini Technology Starter Kit. It is possible to have both v1.2.1 and v2.0 of starter kit installed on a system simultaneously. The scripts within these examples assume that the two releases are located in the /files directory as
  4. Install the jsk-policy.jar into the ext directory inside the J2SE distribution. This is also recommended in the Jini technology installation instructions. This JAR file provides the means for dynamic policy grants for security mechanisms introduced in v2.0 of the starter kit. For more information on this, please review the v2.0 release notes.
  5. Install these examples from the example distribution .tar file. The examples should be able to be run directly from the tree extracted from the distribution .tar file.
Completing these steps should make the system ready to run these examples.

Running the examples on Microsoft Windows

This section will discuss what must be done to run the examples on a typical Microsoft Windows platform.

The files that start Jini services and Jini applications are Windows batch files, which generally run well on any Windows system. Note that there will always be things that must be adjusted from system to system (host names, etc.). Please review the scripts before running them.

The general steps for preparing a computer for running these examples are:

  1. Make the computer network savvy. The name Jini Network Technology strongly suggests that a network is an important part of the environment... and it is. Questions occasionally appear on the various supporting mail lists from users who are having trouble making services work. Some of these problems can be directly traced back to the fact that the computer running the Jini services did not have a properly configured network set up. It is strongly suggested that this step, establishing a solid network configuration, be done before anything else.
  2. Install the Java Programming Language tools. Version 2.0 of the starter kit requires version 1.4.1 or later of J2SE to work properly. All of the examples come pre-built, compiled with this version (or later). While it is possible to compile the examples using an earlier version of Java Technology and run the examples and software from v1.2.1 of the starter kit, it is recommended that the latest version of J2SE be used for all Jini technology development. Be sure the executables associated with this release are included in the execution search path. (That is, typing "java" should start the virtual machine for the Java Programming Language.)
  3. Install v2.0 of the Jini Technology Starter Kit. It is possible to have both v1.2.1 and v2.0 of the starter kit installed on a system simultaneously. The scripts within these examples assume that the two releases are located in the /files directory as
  4. Install the jsk-policy.jar into the ext directory inside the J2SE distribution. This is also recommended in the Jini technology installation instructions. This JAR file provides the means for dynamic policy grants for security mechanisms introduced in v2.0 of the starter kit. For more information on this, please review the v2.0 release notes.
  5. Install these examples from the example distribution .zip file. The examples should be able to be run directly from the tree extracted from the distribution .zip file.
Completing these steps should make the system ready to run these examples.

Creating an environment to (re)build the examples

Building the examples on UNIX

The build mechanism for these examples is Apache Ant. Ant build scripts are named build.xml. These scripts are surprisingly flexible and, as described above, largely platform independent. There are two additional steps beyond those described in the section Running the examples on UNIX that need to be performed in order to have an environment that can build these examples.

  1. Install Ant
    Installation instructions for Ant come with its distribution. It is suggested that Ant be installed in the /files directory alongside the starter kit directories. There are some environment variables that must be set correctly for Ant to work.
  2. Read the ClassDepAndJar documentation
    A version of this tool is bundled with the examples. Follow this link to learn more.
    It is also necessary to include ClassDep in the class path of Ant. This utility is included in the tools.jar file bundled with the starter kit. The tools.jar can be mentioned within the CLASSPATH environment variable (assuming the tools.jar file is located in the /files/jini2_0/lib directory) in a definition such as:
    setenv CLASSPATH /files/jini2_0/lib/tools.jar
    If you are already defining a CLASSPATH environment variable, append the path to the tools.jar to the end of the existing CLASSPATH.

Building the examples on Microsoft Windows

The build mechanism for these examples is Apache Ant. Ant build scripts are named build.xml. These scripts are surprisingly flexible and, as described above, largely platform independent. There are two additional steps beyond those described in the section Running the examples on Microsoft Windows that need to be performed in order to have an environment that can build these examples.

  1. Install Ant
    Installation instructions for Ant come with its distribution. It is suggested that Ant be installed in the c:\files directory alongside the starter kit directories. There are some environment variables that must be set correctly for Ant to work.
  2. Read the ClassDepAndJar documentation
    A version of this tool is bundled with the examples. Follow this link to learn more.
    It is also necessary to include ClassDep in the class path of Ant. This utility is included in the tools.jar file bundled with the starter kit. The tools.jar can be mentioned within the CLASSPATH environment variable (assuming the tools.jar file is located in the c:\files\jini2_0\lib directory) in a definition such as:
    set CLASSPATH=c:\files\jini2_0\lib\tools.jar
    If you are already defining a CLASSPATH environment variable, append the path to the tools.jar to the end of the existing CLASSPATH.

Recommendations

There is a great deal to learn from the examples bundled within this distribution. It is recommended that you study the examples, as they are, before making changes to them (or even rebuilding them).


Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.