This page contains information about using the installed jdk. How to set your environment to use the core java tools.
All JDK versions are installed in
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.
Current Instalation Status
/usr/local/opt/
. This includes the three
directories:
"java"
- contains java 1.1.6 - the latest
official release"java1.2"
- contains java 1.2 - early
access version of the next official release.
Unfortunately this only works oncanna.dcs.ed.ac.uk at the
moment."java1.2b"
- contains java 1.2 beta 4 - the
last beta release for 1.2 - works on all Solaris
terminals.
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.
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:
setup java
setup java1.2
CLASSPATH
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.