首先安装java环境:https://www.linuxidc.com/Linux/2017-11/148695.htm
如果找不到add-命令看https://blog.csdn.net/dogfish/article/details/67150703
直接用default-jdk
update-alternatives –config java查看java目录
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export JRE_HOME=。。。
cd 。。。。。。。/tomcat8/bin
sudo tar zvxf commons-daemon-native.tar.gz
cd commons-daemon-1.0.15-native-src/unix
sudo ./configure –with-java=$JAVA_HOME
sudo make
sudo cp jsvc ../..
sudo useradd -r -s /sbin/nologin tomcat
sudo chown -R tomcat: /路径
之后./daemon start
lsof -i:8009可以查看谁占用了8009端口