The JDK on Sun Workstations

Introduction

This page contains information about using the installed jdk. How to set your environment to use the core java tools.

Current Instalation Status

All JDK versions are installed in /usr/local/opt/. This includes the three directories:

Although installed at /usr/local/opt/, it is advisable to look at the copies located in /home/java/JDK for 1.1.6 and 1.2 as there are some directories located there that are not included in the system wide instalation.

The choice of which version you are going to use should depend on the required portability. Although java is justifiably billed as a portable language, there are certain issues that require attention. Java is still an infant, and as it grows it requires many changes. As a result when it matured from 1.0 to 1.1 the functionality provided by the core packages changed slightly. Support for the 1.0 style of doing things was continued but there was no guarentee that future versions would still support it.

Unfortunately if you are programming applets for use from within a web browser you should take note that the majority of web surfers are only using browsers that support 1.0. To develop programs for these environments you should use 1.1.6 with care.

Perhaps obviously, if you are programming java applications for personal use only, taking advantage of the increased functionality provided by the 1.2 version could be beneficial.

Using Java on the Informatics (South) Network

Setup Environment

To use either of the available jdk versions you need to configure your environment so that the system knows where to look for the binaries and libraries. To do this Informatics South uses the setup command:

  • to setup jdk1.1.6 use: setup java
  • to setup jdk1.2 use: setup java1.2
  • Setup CLASSPATH

    There is one more requirement before you can use the JDK, and this is independent of the version you have setup. You must let the java tools locate the code you wish them to use. This is achieved by setting the CLASSPATH environment variable in the following manner:

    [host]user: export CLASSPATH=/home/my_homedir/location_of_package:$CLASSPATH

    If you want to have the java tools look in more than one directory you should separate each such directory using ":".

    For example consider the homedir java.

    [host]java: export CLASSPATH=/home/java:/home/java/example:$CLASSPATH

    It is often useful to use relative addressing when defining the classpath.

    [host]java: export CLASSPATH=.:$CLASSPATH

    This adds the present directory to the CLASSPATH, but you must be careful as the directory this CLASSPATH defines moves as you change your working directory.

    In jdk 1.1.6 you can also use paths that include the wildcard, *, operator. Note this was removed from 1.2, so you have to fully qualify names.


    Java Support
    Last modified: Fri Sep 4 10:49:53 BST 1998