Lately, I was working on Tomcat 9 and encountered an issue. It was getting stuck at the following stage during startup. Are you also having the same issue? Usually, this happens on VM and here is how you can fix this. Take a backup of a file before modifying and if feasible, test in a non-production environment.

Go to Tomcat installation folder and then bin Open catalina.sh using the vi editor Search for JAVA_OPTS and add the following

For example, I added it here.

Save the file and restart Tomcat

Look at the catalina.out file and it should be started. This simple trick has helped me, and I hope you too! If you are learning or curious to learn more about Tomcat then check out this beginner to the advanced course.