McGill University School of Computer Science
McGill University School of Computer Science
Views
You are here: Java

Java

From Socs Info Wiki

This document provides information related to Java on computer systems at the School of Computer Science, of McGill University.

Java versions on GNU/Linux lab machines

All Gentoo GNU/Linux lab machines at SOCS currently have the following versions of Java:

1.4.2, 1.5.0

The latest version, 1.5, is NOT the system default, instead 1.4.2 is. You can select a non-default version using the program "java-config".

To see what JVMs are available, use the "-L" flag...

$ java-config -L
1) Blackdown JDK 1.4.2.03 [blackdown-jdk-1.4.2] (/usr/share/java-config-2/vm/blackdown-jdk-1.4.2)
*) Blackdown JRE 1.4.2.03 [blackdown-jre-1.4.2] (/usr/share/java-config-2/vm/blackdown-jre-1.4.2)
3) IBM JDK 1.4.2.5 [ibm-jdk-bin-1.4] (/usr/share/java-config-2/vm/ibm-jdk-bin-1.4)
4) IBM JDK 1.5.0.2 [ibm-jdk-bin-1.5] (/usr/share/java-config-2/vm/ibm-jdk-bin-1.5)
5) Sun JDK 1.4.2.12 [sun-jdk-1.4] (/usr/share/java-config-2/vm/sun-jdk-1.4)
6) Sun JDK 1.5.0.08 [sun-jdk-1.5] (/usr/share/java-config-2/vm/sun-jdk-1.5)

The selected version (for the system) is the one with an asterisk ("*") at the start of the line.

To determine what version is selected, use the "-f" flag...

$ java-config -f
blackdown-jdk-1.4.2.02

To select a different version, use the "-s" flag, using either the number at the start of the line, or the string in the square brackets...

$ java-config -s 6

or

$ java-config -s sun-jdk-1.5

This sets the user-specific JVM by putting all necessary environment variables into $HOME/.gentoo/java-env and $HOME/.gentoo/java-env.csh. You will then need to source the file appropriate to your shell ("java-env" is for "sh" and "bash" shells, and "java-env.csh" is for "csh" and "tcsh" shells).

If you have not changed your shell initialization from the defaults, then you do not have to do anything.

Java versions on FreeBSD lab machines

All FreeBSD lab machines at SOCS currently have the following versions of Java:

1.4.2, 1.5.0 in both NATIVE and LINUX INSTALLS

The latest version NATIVE, 1.5, is the system default.

The available JVMs are:

/usr/local/diablo-jdk1.5.0
/usr/local/jdk1.4.2
/usr/local/jdk1.5.0
/usr/local/linux-sun-jdk1.4.2
/usr/local/linux-sun-jdk1.5.0

To determine what version you are using run:

java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00)
Java HotSpot(TM) Client VM (build diablo-1.5.0_07-b00, mixed mode)

To set your version set your environment to one of the directories above:

With the default tcsh shell:

In your .cshrc add:
setenv JAVA_HOME /usr/local/jdk1.4.2

For bash users:

In your .bashrc
export JAVA_HOME=/usr/local/jdk1.4.2