Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven - "files was unexpected at this time"

Tags:

java

maven

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.**

like image 272
kushan Avatar asked Jan 06 '16 11:01

kushan


1 Answers

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.

Home = "C:\Program Files (x86)\Git\bin"

Removed the quotes and change the git home variable as below and now all works fine. :)

Home = C:\Program Files (x86)\Git\bin

This is where the error was

like image 50
kushan Avatar answered Oct 23 '22 11:10

kushan