- Tomcat官網下載,拉到最下面可以看到Binary Distributions,選擇合適的版本,若不確定則選擇Core發行的版本
- 解壓縮後會得到一個apache-tomcat-[version] 文件夾
- 將整包資料夾放入想要安裝tomcat的位置,且可將apache-tomcat-[version] 直接改為tomcat
- 這個安裝tomcat的位置,就是CATALINA_HOME
- 開啟Terminal,設定環境變數
- 在檔案內新增一行 (~/Document/tomcat須代換為安裝tomcat的位置)
- 執行source重新讀取bash_profile
- 執行echo確認環境變數存在
- 啟動tomcat,至~/Document/tomcat/bin執行startup.sh(~/Document/tomcat須代換為安裝tomcat的位置)
vim ~/.bash_profile
export CATALINA_HOME=~/Document/tomcat
source ~/.bash_profile
echo $CATALINA_HOME
sh startup.sh
沒有留言:
張貼留言