1830938 Members
2147 Online
110017 Solutions
New Discussion

/etc/profile

 
SOLVED
Go to solution
Kyle D. Harris
Regular Advisor

/etc/profile

I've never really dealt with /etc/profile much and i'm asked in some install notes to set an environment variable for JAVA_HOME. Here is the exact wording:

vi /etc/profile #Add
export JAVA_HOME=/usr/local/java
PATH=$PATH:$JAVA_HOME/bin
source /etc/profile

My question is, where exactly in /etc/profile do I put this in? right below or above the "export" line or what? Thanks all....

Kyle
1 REPLY 1
Olivier Drouin
Trusted Contributor
Solution

Re: /etc/profile

you edit /etc/profile

you add, in the order, wherever you want.
export JAVA_HOME=/usr/local/java
PATH=$PATH:$JAVA_HOME/bin

Try to be consistent with the rest of the file though...

And then, at the prompt

# source /etc/profile

or you logout/login to set the env variables...