windows tomcat 簡單部署

大飛_dafei發表於2019-04-01

01). 點選startup.bat 閃退(或者在cmd中執行 startup.bat 提示)

D:\soft_position\java\apache-tomcat-9.0.17\bin>startup.bat
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
D:\soft_position\java\apache-tomcat-9.0.17\bin>

需要配置JAVA_HOME 環境變數,

a1) 在windows中新增環境變數可以,

a2) 修改tomcat檔案也可以, 這裡採用修改tomcat的 setclasspath.bat 檔案,新增內容如下:

rem In debug mode we need a real JDK (JAVA_HOME)
if ""%1"" == ""debug"" goto needJavaHome

set JAVA_HOME=D:/soft_position/java/jdk1.8.0_191/  #你的jdk 位置
set JRE_HOME=D:/soft_position/java/jre1.8.0_191/   #你的jre 位置 

02)  點選 startup.bat 出現亂碼,修改 conf/logging.properties 檔案中

logging.properties檔案中

把 java.util.logging.ConsoleHandler.encoding = UTF-8

改為 java.util.logging.ConsoleHandler.encoding = GBK

相關文章