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
Changing JAVA_HOME and PATH are insufficient.
After installing the Java JDK version that you want (Java DEVELOPMENT Kit, not just Java Runtime Environment JRE), change your preferred version with sudo update-alternatives --config java
. If you're on Ubuntu, you probably have 1.6 and 1.7 installed, and 1.8 is available in the PPAs (though I can't find a PPA of 1.8 that's not old).