COLLEGE OF ARTS AND SCIENCES
DEPARTMENT OF COMPUTER SCIENCE
REFERENCE & FORMS

How to set your environment to run java.


Setting up java is pretty simple. All you have to do is change your $PATH and $LD_LIBRARY_PATH environment variables.


Which Version?

--First, you need to know which version of java you'd like to setup. You may need to ask your instructor if you are setting this up for a class. Currently the only two machines you should be programming on (linprog and program) run two versions of java:

Version 1.2.2 (a.k.a JDK 1.2.2) and

Version 1.1

At the UNIX prompt, if you type java -version you will only get the first version of java that the system comes across, so don't trust this information. A better way to check is to type whereis java and you will be given the path(s) to all versions on the system.

$PATH

-- Then, you have to change your path variable to point to /usr/local/java/bin or /usr/local/bin/java, depending on what version of Java you'd like to run and/or what machine you will be using (see NOTE below). To do this, change your $PATH variable in your .tcshrc (or .bash_profile) so that it includes /usr/local/java/bin. You should check first to see if you already have a java directory listed. If so, you'll want to modify this entry rather than adding a new one at the end. This is what my PATH setup looks like:

set path=( ~/.bin ~/.scripts \ /usr/local/bin /usr/local/java/bin /bin /usr/bin /usr/ucb \ /usr/etc /usr/local/bin/X11 /usr/bin/X11 /usr/openwin/bin \ /usr/ccs/bin /usr/sbin . )

It may be hard to read, but there is a space between each path entry. The "\"'s are where the lines wrap. The shell limits the length of these lines, so if your path setting wraps lines be sure to add a "\" at the end of the line before it wraps to the next.

Note the location differences on Program and Linprog

Linprog has v1.2.2

Program has both v1.2.2 and v1.1:

Version 1.2.2 is located in the directory /usr/local/bin/java

Version 1.1 is located in /usr/local/java BUT

on Linprog...

Version 1.2.2 is located in /usr/local/java

...So, the moral of the story is: if you set your $PATH to /usr/local/java then you will run 1.2.2 when on Linprog and 1.1 when on Program (Which is actually convenient if you want to be able to switch from version to version without having to change your PATH variable or type in a long pathname by hand at the command prompt).

Comments or questions should be sent to help@cs.fsu.edu.


Copyright © 1999-2000 Florida State University Computer Science Department
Last modified by webmaster on 2000/10/23 16:37:39.