So I re-installed java in a directory that doesn't have any spaces in it, as I was having issues with it before.
Java JDK is installed in:
E:\downloads\java\jdk
I created a User variable:
JAVA_HOME E:\downloads\java\jdk
And my Path looks like:
%JAVA_HOME%\bin;%M2%;
Now opening a NEW cmd prompt:
c:\java
'java' is not recognized...
but echoing works:
c:\echo %JAVA_HOME%
E:\downloads\java\jdk
and so does this:
c:\%JAVA_HOME%\bin\java -version
java version "1.6.0_17"
I am trying to get this to work, so I can then get maven to work as maven is having the same type of issues (I created M2_HOME and M2 and none work).
What exactly am I doing wrong? I am having the exact same issue on my laptop also, both are running windows 7. I must be missing something!
Edit As per your comments, the output of M2 is:
set M2 M2=E:\downloads\java\apache-maven-2.2.1-bin\apache-maven-2.2.1\bin M2_HOME: e:\downloads\java\apache-maven-2.2.1-bin\apache-maven-2.2.1
set PATH