Jenkamen Jenkamen - 3 months ago 19
Java Question

Mac OS. Apache Tomcat 8. Console window + catalina output + shutdown ctrl+c

I run tomcat like:

exec "/Users/user/apache-tomcat-8.5.4/bin/catalina.sh" start -config /Users/user/tomcat-web-config


but it runs in backgroud.
How to run in new console window and out catalina.out and shutdown by ctrl+c ?

Thanks.

Answer

To run tomcat in console you have to you have to use run command not start.

Do exec "/Users/user/apache-tomcat-8.5.4/bin/catalina.sh" run -config /Users/user/tomcat-web-config so the tomcat will run in the console so you can use Ctrl + C to stope the process.

OTOH

If you use the start command to start tomcat use stop to stop the server.