1. Install jdk
2. Download Tomcat
3. Unzip and store in any directory
4. Start Tomcat
- open terminal
- cd to the directory where the tomcat bin is located
cd /Users/hrh/Library/Tomcat/apache-tomcat-9.0.0.M17\ 2/bin - Enter sudo sh startup.sh to start
successfully
Using CATALINA_BASE: /Users/huruihua/Library/Tomcat
Using CATALINA_HOME: /Users/huruihua/Library/Tomcat
Using CATALINA_TMPDIR: /Users/huruihua/Library/Tomcat/temp
Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
Using CLASSPATH: /Users/huruihua/Library/Tomcat/bin/bootstrap.jar:/Users/huruihua/Library/Tomcat/bin/tomcat-juli.jar
Tomcat started.
-
Access with a browser: http://localhost:8080/
-
Failure cases and solutions
The following prompt appears after entering sudo sh startup.shCannot find ./catalina.sh
The file is absent or does not have execute permission
This file is needed to run this
programExecute this command
chmod +x *.sh in the bin directory of tomcat and
execute sh catalina.sh again to pass,Then use sh startup.sh to start successfully