I just picked up the latest version of the Android SDK and started trying to use it. Unlike almost everyone else coming up with this problem, I'm running Linux, namely Linux Mint 13. I'm currently trying to compile a Hello World program using ant, installed via
sudo apt-get install ant
and ran in the project folder:
ant debug
However, it fails utterly to compile, eventually spitting out an error to do with setting JAVA_HOME
. I amended my ~/.bashrc
file accordingly and restarted, but I still get the error:
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-7-openjdk-amd64/jre"
Total time: 1 second
jamie@jamie-ThinkPad-E525 ~/Downloads/adt-bundle-linux/sdk/tools/projects/new $ echo $JAVA_HOME
/usr/java/jdk1.7.0_05/
As you can see, it's lying through its teeth.
I've found lots of references to this problem, but most people have either set their JAVA_HOME incorrectly, or set it to the JRE. Clearly, I have done neither.
I also amended my project folder's ant.properties
file, adding the line
java.home=/usr/java/jdk1.7.0_05/
to no avail.
Has anyone else experienced/solved this problem, or got any ideas? Thanks.