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
--- Updated after noticing a small item in your output ---
You have your JAVA_HOME set to the correct location for a Java Runtime Environment, which unsuprisingly will allow you to run Java programs, but not develop them.
Shorten your JAVA_HOME to /usr/lib/jvm/java-6-openjdk (note the removal of the trailing jre). After that your Ant wrappers / compiler detection code won't get confused, as it will be pointing to the home of your Java Development Environment instead of the embedded, related Java Runtime Environment.
The embedded Java Runtime Environment is provided to make sure you can test against just the core (compiler tools not included) Java offerings.
--- Original post follows ---
Finding the command javac has little to do with JAVA_HOME beyond that javac is typically found in a subdirectory under JAVA_HOME
What you need to do is to modify your PATH environmental variable to include the directory where the Java executables are located. Typically this is done like so
PATH=${PATH}:${JAVA_HOME}/bin
export PATH
but it might be done slightly differently depending on your setup. If you do
ls ${JAVA_HOME}/bin
and you see a javac executable, then the above modification of the path variable will work without any need to change it.