title: Why maven ignores my JAVA_HOME?
body: <p>This is what I'm getting when <code>mvn</code> is executed from CruiseControl:</p>
  
  <pre>
  Unable to locate the Javac Compiler in:
    /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/tools.jar
  Please ensure you are using JDK 1.4 or above and
  not a JRE (the com.sun.tools.javac.Main class is required).
  In most cases you can change the location of your Java
  installation by setting the JAVA_HOME environment variable.
  </pre>
  
  <p>At the same time, starting it from command line gives correct result. Why <code>mvn</code> is going into this <code>tools.jar</code>? Why it is ignoring my <code>JAVA_HOME</code>? And how can I fix it?</p>
  
  <p>I don't know what are the values of <code>JAVA_HOME/PATH</code> when <code>mvn</code> is started from CC. I would really love to get this information but I don't know how. CC itself is started from user <code>cc</code> and <code>env</code> for this user gives me (it's CentOS 5.4): </p>
  
  <pre><code>JAVA_HOME=/usr/java/default
  PATH=/usr/local/maven/bin:/usr/local/bin:/bin:/usr/bin:/home/cc/bin
  </code></pre>