The problems are to do with your paths.
-
Make sure that the directory “E:\java resources\apache-maven-2.2.0\bin” is on your command search path.
-
Make sure that the JAVA_HOME variable refers to the home directory for your Java installation. If you are executing Java from “E:\Sun\SDK\jdk\bin”, then the JAVA_HOME variable needs to point to “E:\Sun\SDK\jdk”.
NB: JAVA_HOME should NOT end with “\bin”1.
-
Make sure that you haven’t put a semicolon in the JAVA_HOME variable2.
NB: JAVA_HOME should be a single directory name, not “PATH-like” list of directory names separated by semicolons.
Also note that you could run into problems if you have ignored this advice in the Maven on Windows instructions about spaces in key pathnames.
“Maven, like many cross-platform tools, can encounter problems when there are space characters in important pathnames.”
“You need to install the Java SDK (e.g. from Oracle’s download site), and you should install it to a pathname without spaces, such as c:\j2se1.6.”‘
“You need to unpack the Maven distribution. Don’t unpack it in the middle of your source code; pick some location (with no spaces in the path!) and unpack it there.”
The simple remedy for this would be to reinstall Java or Maven in a different location so that there isn’t a space in the path
1 – …. unless you have made an insane choice for the name for your installation location.
2 – Apparently a common “voodoo” solution to Windows path problems is to whack a semicolon on the end. It is not recommended in general, absolutely does not work here.