Mac下環境變數的設定(Java&Tomcat)
阿新 • • 發佈:2021-05-28
1.編輯.bash_profile輸入入下文字,注意替換成你的路徑
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home export CATALINA_HOME=/usr/local/apache-tomcat-8.5.16 export PATH=$PATH:$CATALINA_HOME/bin export SERVLET_JAR=$CATALINA_HOME/lib/servlet-api.jar export JSP_JAR=$CATALINA_HOME/lib/jsp-api.jar export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$SERVLET_JAR:$JSP_JAR export PATH=$JAVA_HOME/bin:$CLASSPATH:$PATH:
2.使.bash_profile檔案設定生效,輸入如下命令
source .bash_profile
轉載於:https://my.oschina.net/hehuiqi/blog/1590284