90

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!

1
  • 11
    I know the answer has been given, but here's the way I found out: after brew install tomcat I did catalina version and found that CATALINA_HOME was set to /usr/local/Cellar/tomcat/<tomcat-version>/libexec. Commented May 2, 2017 at 10:48

8 Answers 8

157
brew ls tomcat

This command will show the directory of brew package.

Sign up to request clarification or add additional context in comments.

1 Comment

It was brew ls tomcat@8 in my case. Therefore, the Tomcat Home: /usr/local/opt/tomcat@8/libexec/
87

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

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

as Tomcat Home in IntelliJ.

Comments

27

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/[email protected]/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

1 Comment

you may need to use /usr/local/opt/tomcat@8/libexec in order to get this to work on intellij
8

It's very simple:

$ catalina home

And you'll probably get: /usr/local/Cellar/tomcat/<VERSION_NUMBER/libexec if you installed tomcat via homebrew.

Comments

7

You should use:

/usr/local/Cellar/tomcat@8/<tomcat version>/libexec/

Comments

4

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

Comments

3

If installed using brew on Mac M1chip the location of tomcat will be

/opt/homebrew/etc/tomcat

Comments

2

The libraries, tools which are installed through brew.sh are stored in

/usr/local/Cellar
  • in your case you can find tomcat in:
/usr/local/Cellar/tomcat

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.