2

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?

CodeMed
  • 9,527
  • 70
  • 212
  • 364

2 Answers2

0

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.

Diego Urenia
  • 1,620
  • 2
  • 21
  • 28
  • Thank you. +1 for trying to help. I looked in the plugins folder of my eclipse installation, and found 19 jar files for m2e. To which of them should I point? And what should I point there? Am I creating windows environment variables? Can you be more explicit? Please not that java -version also produces the same error at the command prompt, even though java is clearly installed and working. I just noticed that the cmd.exe instance I am using is in the sytem32 folder, while these programs might be 64 bit. How would I accommodate that? – CodeMed Aug 27 '13 at 00:43
  • What you have to keep in mind is that you have to configured them as windows environment variables in order to make them work in your command prompt. You are thinking about maven as a plugin only, when you use the STS you already have the maven plugin installed, it's used to build your projects inside the STS, not to use it in command line. To to that you have to point the folder inside your STS installation (Something like: 64bits ~> C:\Program Files\STS\apache-maven3.x and 32bits ~> C:\Program Files (x86)\STS\apache-maven3.x) – Diego Urenia Aug 27 '13 at 00:57
  • If you don't find this folder you can download the maven, put it wherever you want and point to its installation folder in your environment variable. Link: http://maven.apache.org/download.cgi – Diego Urenia Aug 27 '13 at 01:04
  • if none of this helps you, you can go with this step-by-step from the mkyong's blog: http://www.mkyong.com/maven/how-to-install-maven-in-windows/ – Diego Urenia Aug 27 '13 at 01:10
0

"___" 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

sifr_dot_in
  • 3,153
  • 2
  • 33
  • 42