I have set my M2_HOME to
C:\Users\username\Documents\apache-maven-3.5.0
Contents of above directory
09/21/2017 05:13 PM <DIR> .
09/21/2017 05:13 PM <DIR> ..
09/21/2017 05:13 PM <DIR> bin
09/21/2017 05:13 PM <DIR> boot
09/21/2017 05:13 PM <DIR> conf
09/21/2017 05:13 PM <DIR> lib
04/03/2017 08:41 PM 20,934 LICENSE
04/03/2017 08:40 PM 182 NOTICE
04/03/2017 08:36 PM 2,544 README.txt
3 File(s) 23,660 bytes
6 Dir(s) 348,568,027,136 bytes free
However when I run mvn --version in cmd, I get the following error
ERROR: M2_HOME is set to an invalid directory.
M2_HOME = "C:\Users\abhish\Documents\apache-maven-3.5.0"
Please set the M2_HOME variable in your environment to match the
location of the Maven installation
I checked a similar post on SO. However that didnt help, hence posting this question.
I need this solved to solve this problem.