1

I am using IntelliJ 2020.2.4 version on mac Catalina having JDK 1.8_127. I also installed(unzipped) maven in a folder on my PC. I can get return of the version as maven 3.6.3 when I query mvn -version from mac terminal. This is the good part.

Now went in to the IntelliJ terminal and queried mvn -version, I get zsh: command not found: mvn. BTW, while typing the mvn -version command, the command is highlighted in yellow, plus a green text popup in the bottom of the terminal.

I configured in the preferences under Maven, Maven home directory as (tried) both the bundled Maven (3) and the maven I unzipped in some folder on my mac. Both did not work.

Another weird thing

-(I) is when ever I restart the IDE (only then), I see maven tab on the right hand side vertical edge by clicking which we normally run maven life cycle commands like clean, install, verify etc., Once I click on it, it simply vanishes, until I restart the IDE.

-(II)When I try maven -version can return the correct version of maven as 3.6.3 from the unzipped installation. But when I open another mac terminal, the same command returns the message in the title above. What gives ?

Is this some thing permissions issue on Mac ?

How can I either (1) use the unzipped maven binary on my mac which is version 3.6.3 inside IntelliJ (OR) (2) use the bundled maven with IntelliJ by default. (a) When I go to the location of this bundled maven location like /Applications/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/bin and invoke mvn -version I get the same result as above.

I get to ask the following:

  • (a) Why the bundled Maven is not working either inside IntelliJ or directly invoked from terminal

-(b) Why the external zipped install of Maven could not be utilized inside the IntelliJ

PraNuta
  • 629
  • 3
  • 12
  • 33

1 Answers1

0

Seems like this in an Mac OS specific problem. This is what solved it for me:

Open a terminal and make the following:

> vim ~/.zshrc

a
export M2_HOME=/Applications/apache-maven-3.x.x
export PATH=$PATH:$M2_Home/bin/
ESC
:wq

> mvn -version

Where "/Applications/apache-maven-3.x.x" is the path and version of your downloaded und unzipped maven binary of course.

Hope this solves it for other Mac users as well.

webMac
  • 185
  • 1
  • 2
  • 11