Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Maven Install

 
Ranch Hand
Posts: 184
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For some reason I cannot get maven to work on my system. I get a file not found error on my windows7 box.

Path:
  C:\Program Files (x86)\Common Files\Oracle\Java\javapath;
  C:\ProgramData\Oracle\Java\javapath;
  C:\Windows\system32;
  C:\Windows;
  C:\Windows\System32\Wbem;
  C:\Windows\System32\WindowsPowerShell\v1.0\;
  C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;
  C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;
  C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;
  C:\Program Files\Git\cmd;
  C:\Program Files\dotnet\;
  C:\Program Files\Java\jre1.8.0_60\bin;
  C:\Program Files (x86)\Java\jdk1.7.0_55;
  C:\Program Files (x86)\Java\jre7;
  C:\Program Files (x86)\Java\jdk1.8.0_151\bin;
  %JAVA_HOME%\bin;
  %JRE_HOME%\bin;
  %CATALINA_HOME%\lib;
  %M2_HOME%\bin;
  C:\PROGRA~1\IBM\SQLLIB\BIN;
  C:\PROGRA~1\IBM\SQLLIB\FUNCTION;

M2_HOME:
  C:\Program Files (x86)\apache-maven-3.6.0

MAVEN_HOME:
  C:\Program Files (x86)\apache-maven-3.6.0

File Directory (I browsed here from windows explorer)
  C:\Program Files (x86)\apache-maven-3.6.0\bin

File Directory (from command prompt)
  C:\Program Files (x86)\apache-maven-3.6.0\bin>

I can go straight to the directory and type MVN and it works fine, but for some reason it does not pick up the path to the BIN folder. Any suggestions on how to fix this issue?  And yes I have rebooted my system twice now.

Thanks in advanced.
 

 
 
John Morgan
Ranch Hand
Posts: 184
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also just tried C:\Program Files (x86)\apache-maven-3.6.0\bin\mvn and got the same error.
 
Marshal
Posts: 6944
471
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to specify C:\Program Files (x86)\apache-maven-3.6.0\bin directory, where mvn executables are.
 
Saloon Keeper
Posts: 10404
223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens when you invoke the following commands?
 
Sheriff
Posts: 6108
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

John Morgan wrote:also just tried C:\Program Files (x86)\apache-maven-3.6.0\bin\mvn and got the same error.


Does this mean you tried typing this from the command line and you got a "File not found" error?  (It's good to be precise.)  I think from the command line you need to surround a path with quotes if it has spaces in it.
 
Saloon Keeper
Posts: 2653
333
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:I think from the command line you need to surround a path with quotes if it has spaces in it.


You could also use the 8.3 filename in the path - it would be something like: C:\PROGRA~2\apache-maven-3.6.0\bin\mvn

Open a command window and type dir /x c:\ to see the 8.3 filenames.
 
Sheriff
Posts: 21774
103
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That should never be necessary. Just quote your path:
 
John Morgan
Ranch Hand
Posts: 184
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:What happens when you invoke the following commands?



c:\>echo %M2_HOME%
C:\Program Files (x86)\apache-maven-3.6.0 MAVEN_OPTS=-Xms256m -Xmx512m

(That is where the file is located)

c:\>echo %path%
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\nodejs;Z:.

Hmmmm and there the problem is... thank you.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!