Hi DarkLeon, you make me guess, so please correct me if my assumptions are wrong, and hopefully I can answer better.
Did you get java from Sun? I assume you installed it in, e.g., in /usr/java/j2sdk1.4.2_06. Probably your version varies. My convention is a symlink /usr/java/jdk pointing to the former, so I can switch versions easily -- set yours up as you like.
Why do you want to set the PATH variable? I'll assume you'd like your shell to understand commands like javac
etc. instead of /usr/java/j2sdk1.4.2_06/bin/javac
and so on.
To answer the title question, it depends on your shell. I'll assume you also want /bin, so ls
works. In tcsh
set path = (/usr/java/jdk/bin /bin)
setenv PATH /usr/java/jdk/bin:/bin
Those two are exactly equivalent. In reality you'll want more directories, for all commands that you ever type -- e.g., /usr/bin, /usr/local/bin, /sbin, /usr/sbin, /usr/local/sbin. Probably you'll just append /usr/java/jdk/bin to what you already have, i.e.,
set path = ($path /usr/java/jdk/bin)