Maven and Java_Home Maven and Java_Home apache apache

Maven and Java_Home


Actually you need to create


system variable like this:JAVA_HOME = C:\Program Files\Java\jdk1.7.0_45CLASS_PATH = C:\Program Files\Java\jdk1.7.0_45\bin\lib

User variableME = C:\Program Files\apache-maven-3.1.1\binM2_HOME = C:\Program Files\apache-maven-3.1.1MAVEN_OPTS = -Xms256m -Xmx512m

Path - insert into your pathC:\Program Files\apache-maven-3.1.1\bin

Don't forget to reboot system


Read the error message carefully. It says:

... JAVA_HOME = "C:\Program Files\Java\jdk1.7.0_45;" ...

See the stray semicolon? Get rid of it!

The JAVA_HOME variable should contain a directory name ... not a "search path". What you are telling Maven to do is to use a directory whose name contains a semicolon. That directory doesn't exist.


Meta-advice: it pays to read error messages carefully.


I faced the similar situation. I resolved it by removing the semicolon(;) at the end of JAVA_HOME.

JAVA_HOME = C:\Program Files\Java\jdk1.7.0_11

Instead of

JAVA_HOME = "C:\Program Files\Java\jdk1.7.0_11;"