setting path and classpath
I am setting path like:
export JAVA_HOME=/usr/java/jdk1.6.0_01/bin export PATH=$JAVA_HOME;$PATH but when am relogging then I have to reset path again. how can i set the path or classpath permanently thanks & best regards |
What shell are you using? Bash?
If so, you should add those lines to ${HOME}/.bash_profile or ${HOME}/.bashrc If you want other users to also benefit from these settings, add them to /etc/bashrc or /etc/profile instead (requires root access). |
Quote:
[root@bhinternationalltd etc]# echo $PATH /usr/kerberos/sbin:/usr/kerberos/bin://sbin://bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin [root@bhinternationalltd etc]# ${HOME}/.bash_profile -bash: /root/.bash_profile: Permission denied [root@bhinternationalltd etc]# ${HOME}/.bashrc -bash: /root/.bashrc: Permission denied [root@bhinternationalltd etc]# ${HOME}/etc/bashrc -bash: /root/etc/bashrc: No such file or directory [root@bhinternationalltd etc]# |
Quote:
Why permission denied message appear and how can I remove it |
I was telling you to edit the .bash_profile file in your user's home directory.
So ${HOME}/.bash_profile and ${HOME}/.bashrc are OK as paths if you want to run them, but you should open them in an editor instead. ${HOME}/etc/bashrc is an invalid path: ${HOME} variable contains your home directory (ie /home/user or /root for the root user), but this directory probably does not have a subdirectory called "etc". Instead, you need /etc/bashrc (absolute path, not relative to ${HOME}). To see what $HOME contains, just echo it: Code:
echo ${HOME} Code:
. ${HOME}/.bashrc Code:
ls -l ${HOME}/.bashrc ${HOME}/.bash_profile |
All times are GMT -5. The time now is 12:17 PM. |