Kevin Meredith
Kevin Meredith

Reputation: 41939

Failure executing javac, but could not parse the error:

Given the following:

> mvn clean compile
...
[ERROR] Failure executing javac,  but could not parse the error:
/bin/sh: c:/progra~1/java/jdk1.6.0_24/bin/javac: No such file or directory

checked that my mvn and java versions were correct:

$mvn -version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T07:57:37-04:00)
Maven home: /Users/kevin/Downloads/apache-maven-3.3.3
Java version: 1.8.0_51, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.4", arch: "x86_64", family: "mac"

$java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

Unsure of a problem with my brew-installed mvn, I removed it and downloaded mvn-...bin.zip from Apache. Then I set my PATH, verified that mvn -version and java -version spit out the same versions. But, I'm still having the same problem.

I looked at the top 3 (from search) StackOverflow results, but have not gotten any further:

Upvotes: 5

Views: 9682

Answers (2)

Seeker
Seeker

Reputation: 957

I ran into similar issue when i started using a newer version of java. In your case Maven is using java 6. Try setting JAVA_HOME environment variable to correct JDK version. I guess JAVA_HOME is pointing to jdk 1.6.

Upvotes: 0

MrAnno
MrAnno

Reputation: 754

You should check your JAVA_HOME variable or pom.xml for this Windows-specific path: c:/progra~1/java/jdk1.6.0_24/bin/javac and change it to your real JDK installation path (/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre?).

Upvotes: 1

Related Questions