๋ฆฌ๋ˆ…์Šค์—์„œ ์ž๋ฐ” ํ™ˆ ์„ค์ •ํ•˜๊ธฐ์ž…๋‹ˆ๋‹ค. 

 

๊ฐœ์ธ ๊ณ„์ •์—์„œ ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•๊ณผ ๋ชจ๋“  ๊ณ„์ •์„ ์œ„ํ•œ ์„ค์ •๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

(์ž๋ฐ”๋Š” ์ด๋ฏธ ์„ค์น˜๊ฐ€ ๋˜์–ด ์žˆ๋‹ค๊ณ  ๊ฐ€์ •ํ•ฉ๋‹ˆ๋‹ค.)

Set JAVA_HOME / PATH for a single user

 

์ž์‹ ์˜ ๊ณ„์ •์œผ๋กœ ๋กœ๊ทธ์ธํ•ฉ๋‹ˆ๋‹ค.


$ vi ~/.bash_profile 

(์ƒ๋žต)
export JAVA_HOME=/usr/java/jdk1.6.0_45
export PATH=$PATH:/usr/java/jdk1.6.0_45/bin

(์ƒ๋žต)

 

์ด์ œ ์ €์žฅํ•˜๊ณ  vi์—์„œ ๋‚˜์™€์„œ ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค. 


$ source ~/.bash_profile
OR
$ . ~/.bash_profile

 

๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ์ ์šฉ์ด ๋๋Š”์ง€ ํ™•์ธํ•ฉ์‹œ๋‹ค.


$ echo $JAVA_HOME
$ echo $PATH


$ which java

 

Set JAVA_HOME / PATH for all user

์ด๊ฑด ๋ฌผ๋ก  root๊ถŒํ•œ์ด ์žˆ์–ด์•ผ ๊ฒ ์ฃ ? 

์ˆ˜์ •ํ•  ํŒŒ์ผ๋งŒ ๋ฐ”๋€” ๋ฟ ์‚ฝ์ž…ํ•˜๋Š” ๋‚ด์šฉ์€ ๋™์ผํ•ฉ๋‹ˆ๋‹ค.


# vi /etc/profile
(์ƒ๋žต)

export JAVA_HOME=/usr/java/jdk1.6.0_45
export PATH=$PATH:/usr/java/jdk1.6.0_45/bin
(์ƒ๋žต)


์ €์žฅํ•˜๊ณ  ๋‚˜์™€์„œ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.


# source /etc/profile
OR
# . /etc/profille