maven doesnt seem to be installing with springsource tool suite

9.1k Views Asked by At

I recently installed the springsource tool suite plugin for eclipse, running on windows 7. But when I open a command prompt (by typing cmd in the windows start menu) and type in:

mvn --version  

I get the following response:

'mvn' is not recognized as an internal or external command, operable program, or batch file.  

So I then downloaded the stand-alone version of springsource tool suite, which is not what I want. And nonetheless, I still get the same response on the command line when I type in mvn --version. Can anyone tell me how to fix this problem?

I get the same response when I type in java -version . So this might be a command prompt problem. I a following the exact syntax from web tutorials.

EDIT:
I just tried to download m2e in the eclipse marketplace, but got the message that there is nothing new to install. This seems to indicate that I have maven installed, so then how do I access it via the command line in windows 7?

2

There are 2 best solutions below

4
On

You have to configure your Maven environment variable to be able to use it in the command prompt.

In your case there's no need to download the maven binars because it comes with STS, just find the Maven folder inside the STS directory.

0
On

"___" is not recognized as an internal or external command
is shown when program is not installed or the path of that program is not set (to execute from other path).

remember, in "STS", maven is not configured to work out of STS (and terminal usage is out of STS usage).
we have to install it.
maven download link is here
download latest maven from here
extract it where ever you want.

i extracted as below (see the bin,boot,conf,... folders are shown below as in the image): enter image description here

as this maven download is extracted from zip file (it is not setup), you will have to add this extracted path to "PATH" variable in windows environment. follow this to set environment path:
enter image description here enter image description here enter image description here enter image description here

now "mvn" command must work.
but
in my case i had to restart STS (spring tool suit) for this to work