How to find out which folder Tomcat is installed by brew on MacOS?

I am learning JSP programing which requires Tomcat. I followed some tutorials but failed to install successfully(Probably some step is not clear match to my situation)

Then I found out you can install easily by this command line:

brew install tomcat

It looks install is successful,

enter image description here

My challenge is after install, I don't know where it is on my hard drive. Therefore, can't configure it in IntelliJ.

enter image description here

My question is:

How do I find out where Tomcat is installed by brew on MacOS?

Thanks!


Solution 1:

brew ls tomcat

This command will show the directory of brew package.

Solution 2:

In case someone else stumbles upon this: I had to select

/usr/local/Cellar/tomcat/<tomcat-version>/libexec

as Tomcat Home in IntelliJ.