Try   HackMD

Mac OS X 設定 .bash_profile (Java & Maven)

tags: Mac, Java
$ cd ~
$ vi ~/.bash_profile

按下 i 進入編輯模式

輸入

export M2_HOME="/Users/spark/apache-maven-3.6.3"
export PATH="$M2_HOME/bin:$PATH"
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home"

按下 esc 離開編輯模式

同時按下 Shift + :
然後輸入 wq 寫入並離開檔案

$ source ~/.bash_profile

設定立刻生效

測試:

$ echo $JAVA_HOME

出現下圖表示設定成功

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →