First, you can set the PATH for all users except root in /etc/profile, and also each user even root has their own .bash_profile file located in ~ (~ = home foler) where you set the path for that expecific user. To see your path you simple type: echo $PATH at the command prompt; the path is a variable where you tell "linux" in which directories it must search for binary files, there are other enviroment variables for library and stuff too.
Now, down to business
Open a terminal, su to root(su -). then: cd /etc/profile.d/ , there you will create a file: "java.sh" : vim java.sh
Using vim: type: "i" To insert, to start typing, then when you´re done press [Esc] + [Z] [Z] or press [Esc] and type :wq
Ok, in your java.sh file you must put something like this:
Code:
export J2RE_HOME=/java/j2re1.4.2_05
export PATH=$PATH:$J2RE_HOME/bin
Note that you should replace /java/j2re1.4.2_05 with your java path, and maybe it will be different if you downloaded the SDK version.
Now, if you want this new path to work in your current login, you simply do: source /etc/profile.d/java.sh
Hope this helps,