Running Java on LCSR administered Suns

Running Java on LCSR administered Suns

One thing Sun's Java has not been known for is consistency. Each version is a little different from and inconsistent with all others. And for every version of Java we've installed, someone has written code which only works on that version and objects when we want to take it down. The result is that most of our machines have a wide variety of Javas installed. To quickly determine what Javas are installed on any machine, use the following command:
    /bin/ls -d /usr/local/java* | sed 's;.*java;;'

To manage so many versions of Java, we've written a script. To use this script, you must put /usr/local/bin in your path before /usr/bin. This will ensure that, as far as possible, you will be running the same version of Java on all our Suns. You can determine what version of Java you're running with the command:

    java -version

If you need to run a specific version of Java, you can set the environment variable, JAVAVERSION to the version desired. Eg, for version 1.4, you could put

    setenv JAVAVERSION 1.4
in your .login. Note: trying to run java after setting JAVAVERSION to a version which does not exist on the current machine will produce an error.

There are two more values you can set JAVAVERSION to: old and new. old will get you the previous default version of Java. You might use this to complete work you were doing at the time the definitions of the current as well as the old and new versions were changed. new will get you latest version of Java widely available on our systems.

In keeping with our policy to maintain a stable computing environment, we will try to change the definitions of Java versions only between semesters.

This page last updated April 29, 2003.