Tomcat will run in the JVM, and servlets are executed in the Tomcat process (in the same JVM).
Launch Catalina.sh (or .bat) will launch a new JVM for Tomcat to launch. You can load / run Tomcat programmatically within the existing JVM if you need a web server as part of a larger application.
source
share