Before installing the Tomcat with HomeBrew you should make sure the JDK has been installed on your macOS with the java -version commands.
APACHE TOMCAT 8 INSTALL INSTALL
If you find the above method is complicated, you can use HomeBrew to install tomcat directly.To stop tomcat, you can run the command.Click Enter key then you can see the apache tomcat home page. Now open a web browser, input in the URL address input box.Using CLASSPATH: /Users/zhaosong/Documents/WorkSpace/tool/apache-tomcat-9.0.8/bin/bootstrap.jar:/Users/zhaosong/Documents/WorkSpace/tool/apache-tomcat-9.0.8/bin/tomcat-juli.jar Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home Using CATALINA_TMPDIR: /Users/zhaosong/Documents/WorkSpace/tool/apache-tomcat-9.0.8/temp Using CATALINA_HOME: /Users/zhaosong/Documents/WorkSpace/tool/apache-tomcat-9.0.8 Using CATALINA_BASE: /Users/zhaosong/Documents/WorkSpace/tool/apache-tomcat-9.0.8 When you see the below message, it means tomcat has been started successfully.
![apache tomcat 8 install apache tomcat 8 install](https://imgs.developpaper.com/imgs/461446692-5ce499477ad43_articlex.png)
sh file in tomcat bin directory is executable, you can run the command ls -al to see that. sh-3.2# cd /Users/zhaosong/Documents/WorkSpace/tool/apache-tomcat-9.0.8
![apache tomcat 8 install apache tomcat 8 install](https://i.pinimg.com/originals/97/2b/d4/972bd470a63dac854a9a4b6e02fb431e.png)
You can select a zip file or tar.gz file. Download the tomcat install package from page.Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
![apache tomcat 8 install apache tomcat 8 install](https://i.ytimg.com/vi/hxcTamihy-g/maxresdefault.jpg)
Java(TM) SE Runtime Environment (build 1.8.0_172-b11) If you do not have installed JDK, you need to download and install one.