title: Ant unable to find javac, JAVA_HOME won't set on Ubuntu
body: <p>I have an Android Project called Hello on my Ubuntu 10.04 i386 Server (headless). It contains all things an Android project folder should have. I first build the project in bash while in the Project folder using this synax:</p>
  
  <pre><code>./android create project --target 5 --name HelloCompile --path ../../Projects/Hello --activity HelloActivity --package com.code.Hello
  </code></pre>
  
  <p>then I try to build the .apk with ant like so:</p>
  
  <pre><code>ant debug
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>BUILD FAILED
  /home/myusername/www/sdk/tools/ant/main_rules.xml:384: Unable to find a javac compiler;
  com.sun.tools.javac.Main is not on the classpath.
  Perhaps JAVA_HOME does not point to the JDK.
  It is currently set to "/usr/lib/jvm/java-6-openjdk/jre"
  </code></pre>
  
  <p>which is very confusing to me because just before I run <code>ant debug</code> I run:</p>
  
  <pre><code>export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
  </code></pre>
  
  <p>which I know works because <code>printenv</code> in bash shell returns:</p>
  
  <pre><code>JAVA_HOME=/usr/lib/jvm/java-6-openjdk
  </code></pre>
  
  <p>to compound this, adding this line to my /etc/environment file</p>
  
  <pre><code>export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
  </code></pre>
  
  <p>does not fix the problem either - I get the same error. Nothing I do changes the fact Ubunut still thinks <code>/usr/lib/jvm/java-6-openjdk/jre</code> is the JAVA_HOME. What is going wrong? I've been at this for too many hours.</p>