一咖楣、Jdk
JAVA_HOME:C:\software\PATH\jdk1.8\jdk1.8
Path:%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin; (并且置頂)
CLASSPATH:.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar
cmd: java -version
二妙啃、Maven
MAVEN_HOME:C:\software\PATH\apache-maven-3.3.9\apache-maven-3.3.9
path: %MAVEN_HOME%\bin
mvn -version
三聊替、Tomcat
CATALINA_BASE:C:\software\PATH\apache-tomcat-9.0.17\apache-tomcat-9.0.17
CATALINA_HOME:C:\software\PATH\apache-tomcat-9.0.17\apache-tomcat-9.0.17
Path:;%CATALINA_HOME%\lib;%CATALINA_HOME%\bin
3.1 Tomcat中文亂碼解決
1.cmd輸入chcp 若輸出活動代碼頁為936則對應(yīng)的的編碼格式為GB2312
2.Catalina.bat使用notepad選擇編碼格式為GB2312
3.conf/logging.properties文件的“java.util.logging.ConsoleHandler.encoding = UTF-8” 修改為“java.util.logging.ConsoleHandler.encoding = GBK”
3.2 Tomcat一閃而過解決方式
1.文件startup.bat尾部添加pause
2.將catalina.bat中set _EXECJAVA = start 后加/b 變?yōu)?set _EXECJAVA = start /b
:doStart
shift
if "%TITLE%" == "" set TITLE=Tomcat
set _EXECJAVA=start /b "%TITLE%" %_RUNJAVA%
if not ""%1"" == ""-security"" goto execCmd
shift
echo Using Security Manager
set "SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy"
goto execCmd
3.若顯示server.xml錯誤則百度server.xml的配置對比相應(yīng)錯誤信息
4.最后將pause和/b還原
startup.bat
Tomcat目錄下的conf目錄,編輯server.xml文件,我們定位到第69行,可以看到Tomcat的監(jiān)聽端口默認(rèn)為8080
官網(wǎng)下載Tomcat(報錯了就下載重新配置):https://tomcat.apache.org/download-80.cgi
查找錯誤原因