How to find out which folder Tomcat is installed by brew on MacOS?
TomcatHomebrewTomcat Problem Overview
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,
My challenge is after install, I don't know where it is on my hard drive. Therefore, can't configure it in IntelliJ.
My question is:
How do I find out where Tomcat is installed by brew on MacOS?
Thanks!
Tomcat Solutions
Solution 1 - Tomcat
brew ls tomcat
This command will show the directory of brew package.
Solution 2 - Tomcat
In case someone else stumbles upon this: I had to select
/usr/local/Cellar/tomcat/<tomcat-version>/libexec
as Tomcat Home in IntelliJ.
Solution 3 - Tomcat
Although the answer of cbst is working. I think it is better to choose the dynamic path to tomcat which is located in
/usr/local/opt/tomcat
The configuration that I would suggest is the following two Tomcat application servers:
Configuration
Application Server 01
Name: Tomcat latest
Tomcat Home: /usr/local/opt/tomcat/libexec
Application Server 02
Name: Tomcat X.Y
Tomcat Home: /usr/local/opt/tomcat@X.Y/libexec
Advantage
When you upgrade tomcat using
brew upgrade
Your tomcat servers are likely to keep working. If the latest version is a major release your specific version Tomcat X.Y will not work anymore, which is good as you have confidence you are running a correct tomcat version. To keep working with a specific tomcat version use
brew install tomcat@X
Solution 4 - Tomcat
It's very simple:
$ catalina home
And you'll probably get: /usr/local/Cellar/tomcat/<VERSION_NUMBER/libexec
if you installed tomcat via homebrew.
Solution 5 - Tomcat
You should use:
/usr/local/Cellar/tomcat@8/<tomcat version/libexec/
Solution 6 - Tomcat
find / -name "webapps"
run the above command on your terminal of mac. And during the search, it should list out the path of your tomcat directory. in my case, it was:
/Users/jayantagarwal/Documents/apache-tomcat-9.0.14/webapps