标签:windows tomcat环境 windows tomcat 安装服务
Windows环境C:\>systeminfo|find "OS"
OS 名称: Microsoft Windows 7 专业版
OS 版本: 6.1.7601 Service Pack 1 Build 7601
OS 制造商: Microsoft Corporation
OS 配置: 独立工作站
OS 构件类型: Multiprocessor Free
BIOS 版本: American Megatrends Inc. F6, 2017/7/6
jdk:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
tomcat:
https://tomcat.apache.org/download-90.cgi
安装
jdk-8u171-nb-8_2-windows-x64.exe 一路next
C:\> java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
我的电脑—属性—高级系统设置—环境变量-系统变量
新建变量(如有,刚根据实际路径修改)
变量名:JAVA_HOME
变量值:C:\Program Files\Java\jdk1.8.0_171
变量名:CATALINA_HOME
变量值:E:\software\apache-tomcat-9.0.8-windows-x64\apache-tomcat-9.0.8
变量名:CLASSPATH
变量值:%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
最后没有分号
在“系统变量”中找到Path变量,双击打开Path变量,在“变量值”的最后面添加%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;%CATALINA_HOME%\bin
最后没有分号
重启电脑
E:\software\apache-tomcat-9.0.8-windows-x64\apache-tomcat-9.0.8\bin\startup.bat
直接关闭启动时打开的cmd命令窗口
netstat -ano|findstr "8080"
C:\>netstat -ano|find "8080"
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 4884
TCP [::]:8080 [::]:0 LISTENING 4884
查看进程PID和占用内存情况
C:\>tasklist -v | find "4884"
java.exe 4884 Console 1 109,112 K Running ZSWD04\Administrator 0:00:03 Tomcat
语法:
Usage: service.bat install/remove [service_name] [/user username]
C:\>E:\software\apache-tomcat-9.0.8-windows-x64\apache-tomcat-9.0.8\bin\service.bat install tomcat9
Installing the service ‘tomcat9‘ ...
Using CATALINA_HOME: "E:\software\apache-tomcat-9.0.8-windows-x64\apache-tomc
at-9.0.8"
Using CATALINA_BASE: "E:\software\apache-tomcat-9.0.8-windows-x64\apache-tomc
at-9.0.8"
Using JAVA_HOME: "C:\Program Files\Java\jdk1.8.0_171"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_171\jre"
Using JVM: "C:\Program Files\Java\jdk1.8.0_171\jre\bin\server\jvm.d
ll"
The service ‘tomcat9‘ has been installed.
运行> services.msc
会发现名为Apache Tomcat 9.0 tomcat9 的服务项目。手动方式。
Windows 7 JDK 1.8.171 + Tomcat 9.0.8 环境配置
标签:windows tomcat环境 windows tomcat 安装服务
原文地址:http://blog.51cto.com/191226139/2122394