Getting Invalid Maven home directory in IntelliJ with Maven installed via brew

Viewed 1423

I want to set up my locally -via brew- installed Maven in IntelliJ (to not using the bundled one), but always getting a 'Invalid Maven home directory' prompt.

The Maven installation is here:

me@MBP ~ % brew list maven
/opt/homebrew/Cellar/maven/3.8.4/bin/mvn
/opt/homebrew/Cellar/maven/3.8.4/bin/mvnDebug
/opt/homebrew/Cellar/maven/3.8.4/bin/mvnyjp
/opt/homebrew/Cellar/maven/3.8.4/libexec/bin/ (4 files)
/opt/homebrew/Cellar/maven/3.8.4/libexec/boot/ (2 files)
/opt/homebrew/Cellar/maven/3.8.4/libexec/conf/ (3 files)
/opt/homebrew/Cellar/maven/3.8.4/libexec/lib/ (62 files)

When I try to set this path to IntelliJ, I get:

Invalid Maven home directory

What am I doing wrong?

Edit

I've tried similar paths, but nothing seems to work:

Invalid Maven home directory 2

Invalid Maven home directory 3

2 Answers

Try using the libexec folder...

/opt/homebrew/Cellar/maven/3.8.4/libexec

enter image description here

If you don't browse with ... button for Maven home path but copy this path

Intel Mac:

/usr/local/opt/maven/libexec

Silicone Mac:

/opt/homebrew/opt/maven/libexec

into the input field then brew update won't break Maven access.

Related