Maven - "files was unexpected at this time"

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


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

Tags:

Java

Maven