macOS JAVA_HOMEのPATHを設定する方法

環境
mac OS

操作方法
1.PATHの設定を行います

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$ echo 'export JAVA_HOME=<path>' >> ~/.bash_profile
$ echo 'export PATH=$JAVA_HOME/bin:$PATH>' >> ~/.bash_profile
$ echo 'export JAVA_HOME=<path>' >> ~/.bash_profile $ echo 'export PATH=$JAVA_HOME/bin:$PATH>' >> ~/.bash_profile
$ echo 'export JAVA_HOME=<path>' >> ~/.bash_profile
$ echo 'export PATH=$JAVA_HOME/bin:$PATH>' >> ~/.bash_profile

2.「.bash_profile」の更新を行います

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$ source ~/.bash_profile
$ source ~/.bash_profile
$ source ~/.bash_profile

3.PATHが反映されてることを確認する

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$ echo $JAVA_HOME
$ echo $PATH
$ echo $JAVA_HOME $ echo $PATH
$ echo $JAVA_HOME
$ echo $PATH

 

Mac OS X

Posted by arkgame