The original post below applies to old versions. For 0.4.x plus, you don’t need to do this. You just need to have a proper Oracle JRE/JDK installed system wide which you can do with this:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update && sudo apt-get install oracle-jdk7-installer
With the recent preview release of Android Studio it’s important to know that it won’t work properly on Ubuntu with the OpenJDK that’s available.
Fortunately, it’s easy to get it going.
- Download the official Oracle JDK
- Unpack it (I put mine in ~/SDK/jdk1.7.0_21/ )
- Point your JAVA_HOME to this.
~/android-studio/bin$ export JAVA_HOME=~/SDK/jdk1.7.0_21/
- Run the android studio startup script.
- Make awesome android apps.