- CentOS7.2
- Tomcat9
- JDK8
Ich fange schon JAVA_HOME
in meinem evn gesetzt und catalina.sh run
in cammand Linie laufen, ist tomcat Erfolg starten. Aber ich benutze systemctl start tomcat.service
ich bekomme einen Fehler.Tomcat kann nicht mit systemctl auf centos7.2
11月 04 22:13:02 iZwz90squb7zj67pw5hyizZ systemd[1]: Starting tomcat...
11月 04 22:13:02 iZwz90squb7zj67pw5hyizZ startup.sh[1058]: Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
11月 04 22:13:02 iZwz90squb7zj67pw5hyizZ startup.sh[1058]: At least one of these environment variable is needed to run this program
11月 04 22:13:02 iZwz90squb7zj67pw5hyizZ systemd[1]: tomcat.service: main process exited, code=exited, status=1/FAILURE
11月 04 22:13:02 iZwz90squb7zj67pw5hyizZ systemd[1]: Failed to start tomcat.
11月 04 22:13:02 iZwz90squb7zj67pw5hyizZ systemd[1]: Unit tomcat.service entered failed state.
11月 04 22:13:02 iZwz90squb7zj67pw5hyizZ systemd[1]: tomcat.service failed.
Hier ist meine tomcat.service
.
[Unit]
Description=tomcat
After=network.target
[Service]
Type=oneshot
Environment=CATALINA_PID=/var/run/tomcat.pid
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
ExecStart=/usr/local/tomcat/bin/startup.sh
ExecStop=/usr/local/tomcat/bin/shutdown.sh
ExecReload=/usr/bin/kill -s HUP $MAINPID
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Hallo, ich habe dasselbe Problem und habe diese Lösung aber nicht funktioniert. Bitte helfen Sie mir –