Laboratory: Using the Sun JDK
CSC 207 Algorithms and Object Oriented Design Spring 2009

Summary: How to configure your shell to use the Sun JDK on the MathLAN machines.

Steps

  1. Open the file ~/.bashrc in your favorite text editor
  2. Somewhere near the end, but before any final export commands, add the following lines:
    JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
    PATH=$JAVA_HOME/bin:$PATH
    
  3. If there is already a line with an export command near the end, make sure the environment variable PATH is among the parameters, and also add JAVA_HOME to the list. In other words, there may be other variables listed, but be sure after the declarations listed in step 2, you have a line like the following:
    export PATH JAVA_HOME
  4. Do the same thing to your ~/.bash_profile (you may have already done this in class).
  5. The next time you log in to MathLAN, you should see output something like the following:
    laplace:~$ which javac
    /usr/lib/jvm/java-1.5.0-sun/bin/javac
    
Jerod Weinman
Created: 26 January 2009