I set the following system veriables (OS = Vista):
M2_HOME = C:\Program Files\Maven
M2 = %M2_HOME%\bin
path = %M2%
If i run mvn — version I get:
mvn: command not found
Anyone have any idea why this could be?
Thanks.
asked May 18, 2012 at 9:04
3
Maven setup:
a. install maven from https://maven.apache.org/download.cgi
b. unzip maven and keep in C drive.
c. Set MAVEN_HOME in system variable.
d. Set path for maven
answered Aug 25, 2019 at 11:36
Abdur RahmanAbdur Rahman
1,4201 gold badge21 silver badges32 bronze badges
I followed this tutorial: How to install Maven on Windows
But running mvn -version
, I still got:
mvn: command not found
So, I closed the current git window, and opened a new one.
Everything went okay
valiano
16.6k7 gold badges64 silver badges79 bronze badges
answered May 29, 2017 at 7:01
emdhieemdhie
3791 gold badge3 silver badges10 bronze badges
1
If you are on windows, what i suppose you need to do set the PATH like this:
SET PATH=%M2%
furthermore i assume you need to set your path to something like C:…\apache-maven-3.0.3\ cause this is the default folder for the windows archive.
On the other i assume you need to add the path of maven to your and not set it to only maven so you setting should look like this:
SET PATH=%PATH%;%M2%
answered May 18, 2012 at 9:12
khmarbaisekhmarbaise
93.3k28 gold badges189 silver badges235 bronze badges
4
I tried solutions from other threads. Adding M2 and M2_HOME at System variables, and even at User variables. Running cmd as admin. None of the methods worked.
But today I added entire path to maven bin to my System variables «PATH» (C:\Program Files (x86)\Apache Software Foundation\apache-maven-3.1.0\bin) besides other paths, and so far it’s working good. Hopefully it’ll stay that way.
answered Aug 16, 2013 at 18:07
Howard LeeHoward Lee
9771 gold badge11 silver badges20 bronze badges
I think the tutorial passed by @emdhie will help a lot.
How install maven
But, i followed and still getting mvn: command not found
I found this solution to know what was wrong in my configuration:
I opened the command line and called this command:
../apache-maven-3.5.3/bin/mvn --version
After that i got the correct JAVA_HOME and saw that my JAVA_HOME was wrong.
Hope this helps.
answered Aug 27, 2019 at 21:11
- Run ‘path‘ in command prompt and ensure that the maven installation directory is listed.
- Ensure the maven is installed in ‘C:\Program Files\Maven’.
answered May 18, 2012 at 9:15
1
I think the problem is with the spaces. I had my variable at the System variables but it didn’t work. When I changed variable Progra~1 = 'Program Files'
everything works fine.
M2_HOME C:\Progra~1\Maven\apache-maven-3.1.1
I also moved my M2_HOME
at the end of the PATH(%M2_HOME%\bin)
I’m not sure if this has any difference.
answered Jan 21, 2014 at 12:36
Follow these steps MAVEN
Again this does not work, hit this command in the Powershell
$env:Path = "$env:Path;C:\path\to\maven\bin"
Make sure to close and reopen the powershell and try mvn -version
answered Feb 7 at 2:47
AamerAamer
4373 silver badges9 bronze badges
sudo apt-get install maven — this made it for me on a vagrant machine with docker installed
answered Sep 20 at 7:33
zazoupilezazoupile
1421 silver badge15 bronze badges
mvn -version
export PATH=$PATH:/opt/apache-maven-3.6.0/bin
answered Feb 6, 2019 at 5:05
2
I set the following system veriables (OS = Vista):
M2_HOME = C:\Program Files\Maven
M2 = %M2_HOME%\bin
path = %M2%
If i run mvn — version I get:
mvn: command not found
Anyone have any idea why this could be?
Thanks.
asked May 18, 2012 at 9:04
3
Maven setup:
a. install maven from https://maven.apache.org/download.cgi
b. unzip maven and keep in C drive.
c. Set MAVEN_HOME in system variable.
d. Set path for maven
answered Aug 25, 2019 at 11:36
Abdur RahmanAbdur Rahman
1,4201 gold badge21 silver badges32 bronze badges
I followed this tutorial: How to install Maven on Windows
But running mvn -version
, I still got:
mvn: command not found
So, I closed the current git window, and opened a new one.
Everything went okay
valiano
16.6k7 gold badges64 silver badges79 bronze badges
answered May 29, 2017 at 7:01
emdhieemdhie
3791 gold badge3 silver badges10 bronze badges
1
If you are on windows, what i suppose you need to do set the PATH like this:
SET PATH=%M2%
furthermore i assume you need to set your path to something like C:…\apache-maven-3.0.3\ cause this is the default folder for the windows archive.
On the other i assume you need to add the path of maven to your and not set it to only maven so you setting should look like this:
SET PATH=%PATH%;%M2%
answered May 18, 2012 at 9:12
khmarbaisekhmarbaise
93.3k28 gold badges189 silver badges235 bronze badges
4
I tried solutions from other threads. Adding M2 and M2_HOME at System variables, and even at User variables. Running cmd as admin. None of the methods worked.
But today I added entire path to maven bin to my System variables «PATH» (C:\Program Files (x86)\Apache Software Foundation\apache-maven-3.1.0\bin) besides other paths, and so far it’s working good. Hopefully it’ll stay that way.
answered Aug 16, 2013 at 18:07
Howard LeeHoward Lee
9771 gold badge11 silver badges20 bronze badges
I think the tutorial passed by @emdhie will help a lot.
How install maven
But, i followed and still getting mvn: command not found
I found this solution to know what was wrong in my configuration:
I opened the command line and called this command:
../apache-maven-3.5.3/bin/mvn --version
After that i got the correct JAVA_HOME and saw that my JAVA_HOME was wrong.
Hope this helps.
answered Aug 27, 2019 at 21:11
- Run ‘path‘ in command prompt and ensure that the maven installation directory is listed.
- Ensure the maven is installed in ‘C:\Program Files\Maven’.
answered May 18, 2012 at 9:15
1
I think the problem is with the spaces. I had my variable at the System variables but it didn’t work. When I changed variable Progra~1 = 'Program Files'
everything works fine.
M2_HOME C:\Progra~1\Maven\apache-maven-3.1.1
I also moved my M2_HOME
at the end of the PATH(%M2_HOME%\bin)
I’m not sure if this has any difference.
answered Jan 21, 2014 at 12:36
Follow these steps MAVEN
Again this does not work, hit this command in the Powershell
$env:Path = "$env:Path;C:\path\to\maven\bin"
Make sure to close and reopen the powershell and try mvn -version
answered Feb 7 at 2:47
AamerAamer
4373 silver badges9 bronze badges
sudo apt-get install maven — this made it for me on a vagrant machine with docker installed
answered Sep 20 at 7:33
zazoupilezazoupile
1421 silver badge15 bronze badges
mvn -version
export PATH=$PATH:/opt/apache-maven-3.6.0/bin
answered Feb 6, 2019 at 5:05
2
Solution 1
If you are on windows, what i suppose you need to do set the PATH like this:
SET PATH=%M2%
furthermore i assume you need to set your path to something like C:…\apache-maven-3.0.3\ cause this is the default folder for the windows archive.
On the other i assume you need to add the path of maven to your and not set it to only maven so you setting should look like this:
SET PATH=%PATH%;%M2%
Solution 2
I followed this tutorial: How to install Maven on Windows
But running mvn -version
, I still got:
mvn: command not found
So, I closed the current git window, and opened a new one.
Everything went okay
Solution 3
Maven setup:
a. install maven from https://maven.apache.org/download.cgi
b. unzip maven and keep in C drive.
c. Set MAVEN_HOME in system variable.
d. Set path for maven
Solution 4
I tried solutions from other threads. Adding M2 and M2_HOME at System variables, and even at User variables. Running cmd as admin. None of the methods worked.
But today I added entire path to maven bin to my System variables «PATH» (C:\Program Files (x86)\Apache Software Foundation\apache-maven-3.1.0\bin) besides other paths, and so far it’s working good. Hopefully it’ll stay that way.
Comments
-
I set the following system veriables (OS = Vista):
M2_HOME = C:\Program Files\Maven M2 = %M2_HOME%\bin path = %M2%
If i run mvn — version I get:
mvn: command not found
Anyone have any idea why this could be?
Thanks.
Recents
I set the following system veriables (OS = Vista):
M2_HOME = C:\Program Files\Maven
M2 = %M2_HOME%\bin
path = %M2%
If i run mvn — version I get:
mvn: command not found
Anyone have any idea why this could be?
Thanks.
This question is related to
windows
maven
The answer is
If you are on windows, what i suppose you need to do set the PATH like this:
SET PATH=%M2%
furthermore i assume you need to set your path to something like C:…\apache-maven-3.0.3\ cause this is the default folder for the windows archive.
On the other i assume you need to add the path of maven to your and not set it to only maven so you setting should look like this:
SET PATH=%PATH%;%M2%
I tried solutions from other threads. Adding M2 and M2_HOME at System variables, and even at User variables. Running cmd as admin. None of the methods worked.
But today I added entire path to maven bin to my System variables «PATH» (C:\Program Files (x86)\Apache Software Foundation\apache-maven-3.1.0\bin) besides other paths, and so far it’s working good. Hopefully it’ll stay that way.
I followed this tutorial: How to install Maven on Windows
But running mvn -version
, I still got:
mvn: command not found
So, I closed the current git window, and opened a new one.
Everything went okay
I think the problem is with the spaces. I had my variable at the System variables but it didn’t work. When I changed variable Progra~1 = 'Program Files'
everything works fine.
M2_HOME C:\Progra~1\Maven\apache-maven-3.1.1
I also moved my M2_HOME
at the end of the PATH(%M2_HOME%\bin)
I’m not sure if this has any difference.
I think the tutorial passed by @emdhie will help a lot.
How install maven
But, i followed and still getting mvn: command not found
I found this solution to know what was wrong in my configuration:
I opened the command line and called this command:
../apache-maven-3.5.3/bin/mvn --version
After that i got the correct JAVA_HOME and saw that my JAVA_HOME was wrong.
Hope this helps.
- Run ‘path‘ in command prompt and ensure that the maven installation directory is listed.
- Ensure the maven is installed in ‘C:\Program Files\Maven’.
mvn -version
export PATH=$PATH:/opt/apache-maven-3.6.0/bin
New answer, powershell
TCP
Get-Process -Id (Get-NetTCPConnection -LocalPort YourPortNumberHere).OwningProcess
UDP
Get-Process -Id (Get-NetUDPEndpoint -LocalPort YourPortNumberHere).OwningProcess
Old answer, cmd
C:\> netstat -a -b
(Add -n to stop it trying to resolve hostnames, which will make it a lot faster.)
Note Dane’s recommendation for TCPView. It looks very useful!
-a Displays all connections and listening ports.
-b Displays the executable involved in creating each connection or listening port. In some cases well-known executables host multiple independent components, and in these cases the sequence of components involved in creating the connection or listening port is displayed. In this case the executable name is in [] at the bottom, on top is the component it called, and so forth until TCP/IP was reached. Note that this option can be time-consuming and will fail unless you have sufficient permissions.
-n Displays addresses and port numbers in numerical form.
-o Displays the owning process ID associated with each connection.
From this news group posting by Mark Zbikowski himself:
The differences between .CMD and .BAT as far as CMD.EXE is concerned
are: With extensions enabled, PATH/APPEND/PROMPT/SET/ASSOC in .CMD
files will set ERRORLEVEL regardless of error. .BAT sets ERRORLEVEL
only on errors.
In other words, if ERRORLEVEL is set to non-0 and then you run one of those commands, the resulting ERRORLEVEL will be:
- left alone at its non-0 value in a .bat file
- reset to 0 in a .cmd file.