Eliott Roynette
Eliott Roynette

Reputation: 734

Probleme with JAVA_HOME in maven for android using Eclipse

I am new in maven utilisation, I want to use it to generate an apk of my android appication. When i am launching the "compile" and others i recieve this error message :

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project android.app: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files\Java\jre7\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.

So I set the JAVA_HOME to my jdk with that :The JAVA_HOME setting

But I still have the same problem even after restart my computer.

Do you have any idea why ?

EDIT----

I don't know if it change something but I am using eclipse to launch maven build

Upvotes: 0

Views: 294

Answers (2)

Eliott Roynette
Eliott Roynette

Reputation: 734

I finally fix the problem. When you launch maven from eclipse, by default, it using the eclipse jre and not JAVA_HOME. So I change the eclipse jre to the jdk and it is working.

Upvotes: 0

Nexowski
Nexowski

Reputation: 335

I'm supposing you use Eclipse, or not? For Eclipse:

Click on Debug->Debug Configurations.... Click on Maven Build, select the one u use. You have a tab called JRE. Click on it. There is the place where you can get the choice.

Normally Maven takes the JRE/JDK which is set default in Eclipse, so if you didn't change your default JRE/JDK i nyour workspace then it will be like that.

Upvotes: 1

Related Questions