[root@yoyo ~]# java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
[root@yoyo ~]#
接着输入javac,如果能看到内容输出就说明已经安装好了
[root@yoyo ~]# javac
Usage: javac
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath Specify where to find user class files and annotation processors
[root@yoyo tomcat]# systemctl start tomcat
[root@yoyo tomcat]# systemctl status tomcat
● tomcat.service - Apache Tomcat Web Application Container
Loaded: loaded (/usr/lib/systemd/system/tomcat.service; disabled; vendor preset: disabled)
Active: active (running) since Fri 2018-12-28 10:48:38 CST; 5s ago
Main PID: 5216 (java)
CGroup: /system.slice/tomcat.service
└─5216 /usr/lib/jvm/jre/bin/java -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin...
Dec 28 10:48:38 yoyo server[5216]: Dec 28, 2018 10:48:38 AM org.apache.catalina.core.StandardService startInternal
Dec 28 10:48:38 yoyo server[5216]: INFO: Starting service Catalina
Dec 28 10:48:38 yoyo server[5216]: Dec 28, 2018 10:48:38 AM org.apache.catalina.core.StandardEngine startInternal
Dec 28 10:48:38 yoyo server[5216]: INFO: Starting Servlet Engine: Apache Tomcat/7.0.76
Dec 28 10:48:38 yoyo server[5216]: Dec 28, 2018 10:48:38 AM org.apache.coyote.AbstractProtocol start
Dec 28 10:48:38 yoyo server[5216]: INFO: Starting ProtocolHandler ["http-bio-8080"]
Dec 28 10:48:38 yoyo server[5216]: Dec 28, 2018 10:48:38 AM org.apache.coyote.AbstractProtocol start
Dec 28 10:48:38 yoyo server[5216]: INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Dec 28 10:48:38 yoyo server[5216]: Dec 28, 2018 10:48:38 AM org.apache.catalina.startup.Catalina start
Dec 28 10:48:38 yoyo server[5216]: INFO: Server startup in 61 ms
Hint: Some lines were ellipsized, use -l to show in full.
[root@yoyo tomcat]#
可以看到状态是 Active: active (running) , 此时已经代表 tomcat 已经正常的跑起来了。
也可以查看 Main PID: 5216 (java)知道PID是5216