user962206
user962206

Reputation: 16147

Java is Set to an Invalid Directory

I am trying to set up maven, however when I tried maven --version

note I already viewed this question Unable to install Maven on Windows: "JAVA_HOME is set to an invalid directory"

I tried the solutions here but it still did not work. however still di not work

here is the error

ERROR: JAVA_HOME is set to an invalid directory.
JAVA_HOME = "C:\Program Files\Java\jdk1.6.0_24\bin\java.exe"
Please set the JAVA_HOME variable in your environment to match th
location of your Java installation

Upvotes: 0

Views: 1423

Answers (3)

Chinmoy
Chinmoy

Reputation: 1476

I faced the similar situation.

The solution is to remove 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;"

Upvotes: 0

Sanjaya Liyanage
Sanjaya Liyanage

Reputation: 4746

If you didn't install java and did copy paste it then set the JAVA_HOME

C:\Program Files\Java\jdk1.6.0_24\bin

and add it to the path variable as well

Upvotes: -1

Reimeus
Reimeus

Reputation: 159844

Set the environment variable named JAVA_HOME to where the JDK is installed, i.e.

C:\Program Files\Java\jdk1.6.0_24

Upvotes: 7

Related Questions