1. Setting JAVA_HOME for root, will it be different from JAVA_HOME variable of other users?
No, if everyone's using same path. JAVE_HOME variable carries full path where jave is installed. For a single system it should be same.
2. If in some file JAVA_HOME is already set, then setting it again will replace older value?
Yes, it will.
3. Is it set in .cshrc file in home directory of any user for a c shell?
Depends. It can be set in .cshrc if you're using c shell.
4. What are the commands to set?
For c shell it can be set using:
Code:
setenv JAVA_HOME /path/to/java
5. If set in c shell, do i have to reset the variable for other shells also like bash?
Yes, for every different sheell, you'll once need to set it. For bash, set it in .bashrc or in .bash_profile, as:-
Code:
set JAVA_HOME=/path/to/java; export JAVA_HOME