Environment variables are not being parmanent
Hi,
I need to set up few environment variables . Those variables are set up successfully and works perfect during a session, but when I close my remote session then those environment variables are gone. I have tried using both root and general user and same thing happens. But when I installed java the environment variable for java setup perfectly (automatic by software setup) and works all the time. I am trying for example- export CATALINA_HOME=/usr/local/jakarta/tomcat export PATH=${PATH}:${CATALINA_HOME}/bin Any suggestion on how to solve this problem? Thanks a lot in advance. |
You need to set those in your ~/.bash_profile or ~/.bashrc file. If you log into the remote system, then use .bash_profile. If you're just spawning terminals, use .bashrc.
|
You would typically have to edit the startup scripts to set variables during system startup. Note that something like PATH can get set/modified in more than one script.
Which script(s) sets (changes) a variable varies between systems. |
Set those variables in your ~/.bashrc file, or in /etc/profile if you want it to affect all users.
|
Most likely the JAVA related environment is set in some startup script like /etc/profile.d/java.sh. Many applications use the /etc/profile.d directory as a place to set their own environment. The scripts inside /etc/profile.d are sourced by /etc/profile using the following piece of code
Code:
for i in /etc/profile.d/*.sh ; do |
Wow!! Thanks a lot for your help!! What I was doing was scratching my head pretty hard for last few days what could be the problem... and I now got the solution in few minutes!!
You people are great :) Thanks a lot. |
All times are GMT -5. The time now is 01:33 AM. |