On ubuntu I have tried all the methods that are described here but none worked.
What I did in the end was to:
download JDK from oracle, extract the archive
edit android-studio/bin/studio.sh
and add at the top
export JAVA_HOME=/path/to/jdk
save the file and cd android-studio/bin
and launch Android Studio: ./studio.sh