I'm trying to install maven to my PC.(windows 7)
Following are the steps I have done.
1. Installed Java 1.8.0.11
2. Added a system variable JAVA_HOME = C:\Program Files\Java\jdk1.8.0_11
3. Appended it to the path - PATH=%JAVA_HOME%\bin;C:\Program Files\......;... etc
4. Typed "Java -version" in command line and got the java version details as usual.
5. Then I downloaded and extracted the Maven 3.3.3
6. Added the M2_HOME to system variable.M2_HOME=C:\Program Files\apache-maven-3.3.3\apache-maven-3.3.3
7. Added M2 Variable M2=%M2_HOME%\bin
8. Appended M2 to Path variable. PATH=%M2%;%JAVA_HOME%\bin;....;...etc
9. Typed mvn --version in command line.
Get the following error.
Files was unexpected at this time.
What is wrong here? Please help me to get this resolved.
Thanks in advance!
**Note - I have not use quotes for any of the paths here. also I tried with 8 char syntax for folder names like this:
set java_home="c:\Progra~1\Java"
Non of these were resolved the issue. Please read the steps I have added and help me to get this resolved.**
Try adding
to
PATH
variableI had a similar issue
Files\apache-maven-3.3.9""=="" was unexpected at this time.
and when looking at "Environment Variables" inside "System Properties" there were no quotes (") inside of any variables, but before doing that I was following a tutorial and set those values via cmd:
C:\Program Files\apache-maven-3.3.9\bin>set M2_HOME="C:\Program Files\apache-maven-3.3.9"
So, in order to fix it I just re-run the following in cmd:
C:\Program Files\apache-maven-3.3.9\bin>set M2_HOME=C:\Program Files\apache-maven-3.3.9
(removed " from cmd assignment) I hope this helps someone.
I was facing same issue in
jenkins
when I asked jenkins to installmaven
internally. Notice double quotes below whenjenkins
was firing a buildTo resolve this I downloaded maven and manually set the path in jenkins and it was resolved.
Finally I was able to resolved the issue.
A quoted value in the user variables has caused to the "Files were unexpected at this time" error in maven.
I spent hours of time with changing Java_home and M2_home variables with different combinations but finally checked the user variable and noted the quotes there.
Removed the quotes and change the git home variable as below and now all works fine. :)