Issue
I want to modify apache tomcat9 for my goals so I want to know where the start point of the program as main method?
Solution
One of the tip is to use jps
(A CLI tool shipped with Java SDK) to print out the main method that start a Java Process after you start Tomcat. You have to use -l
if you want to display full patch of the main method and -m
to display the arguments passed to the main method :
jps -lmv
Then it will show something like :
6622 org.apache.catalina.startup.Bootstrap start --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -Djava.util.logging.config.file=/Users/kc/Downloads/apache-tomcat-9.0.8/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -Dcatalina.base=/Users/kc/Downloads/apache-tomcat-9.0.8 -Dcatalina.home=/Users/kc/Downloads/apache-tomcat-9.0.8 -Djava.io.tmpdir=/Users/kc/Downloads/apache-tomcat-9.0.8/temp
which means the main method that start Tomcat is the class org.apache.catalina.startup.Bootstrap
Answered By - Ken Chan