Mano Kugan
Mano Kugan

Reputation: 219

Unable to get the maven installation path

I have installed maven 3.6.0 in my mac using homebrew. When I try

mvn --version 

in my terminal, I get the

Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-25T05:41:47+11:00)
Maven home: /usr/local/Cellar/maven/3.6.0/libexec
Java version: 11.0.2, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home
Default locale: en_AU, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.3", arch: "x86_64", family: "mac"

But when I try ,

whereis mvn

I dont receive anything in return? Can someone let me know what I have done wrong in the installation

Upvotes: 1

Views: 3530

Answers (3)

Ranch Camal
Ranch Camal

Reputation: 570

Type mvn --version you will get the following informations:

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\dev\apache-maven-3.6.3\bin\..
Java version: 1.8.0_275, vendor: ojdkbuild, runtime: C:\Java\1.8\jre
Default locale: en_CA, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Upvotes: 0

user11239955
user11239955

Reputation:

If you're looking for the installation folder, mvn --version shows you the path.

Maven home: /usr/local/Cellar/maven/3.6.0/libexec

Even better, try:

which mvn

Reason why whereis couldn't return is explained here.

Upvotes: 4

manoj mallick
manoj mallick

Reputation: 30

Download the Maven, for example apache-maven-3.x.x-bin.tar.gz. Extracts it,

tar -xvf apache-maven-3.x.x-bin.tar.gz $pwd /Users/mkyong/apache-maven-3.x.x

Copy

2.2 – Set Maven command in environment variable. Update ~/. bash_profile – create this file if doesn’t exist.

$ vim ~/.bash_profile

Copy

~/.bash_profile

export M2_HOME=/Users/mkyong/apache-maven-3.x.x export PATH=$PATH:$M2_HOME/bin

Copy

Restart the terminal. Test it.

Then whereis mvn will work

Upvotes: 0

Related Questions