Reputation: 916
I'm working on Fedora, my java home is set as :
export JAVA_HOME=/home/UserName/java
export M3_HOME=/home/UserName/softwares/apache-maven-3.0.3
export PATH=$PATH:/home/UserName/java/bin:/home/Udeshika/softwares/apache-maven-3.0.3/bin
Now when I try to run mvn install
for maven project, I'm getting following error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project viewer: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] /home/UserName/java/jre/../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.
[ERROR] -> [Help 1]
[ERROR]
if I check my maven version
Apache Maven 3.0.3 (r1075438; 2011-02-28 23:01:09+0530)
Maven home: /home/UserName/softwares/apache-maven-3.0.3
Java version: 1.6.0_07, vendor: Sun Microsystems Inc.
Java home: /home/UserName/java/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.34.9-69.fc13.i686.pae", arch: "i386", family: "unix"
Here maven tells my JAVA_HOME is
Java home: /home/UserName/java/jre
I think I have identified the problem now I don't know to solve it can anyone guide me to solve this problem ??
Thank you in advance
Upvotes: 0
Views: 1714
Reputation: 32587
You need to have a Java SDK in order to use Maven. The SDK contains the tools.jar and allows you to compile, whereas the JRE is just a runtime.
Upvotes: 1