Summary: Check ~ / .profile (and not ~ / .bashrc) to set the environment variable pointing to the jdk 1.8 folder.
I got such a problem when I upgrade Android Studio from version 2.1 to version 2.2 under Ubuntu.
You can check studio.sh in the Android Studio installation folder to find out how it checks the Java version. It says: Find the JDK installation directory that will be used to start the IDE. Try (in order): STUDIO_JDK, .. / jre, JDK_HOME, JAVA_HOME, "java" in PATH.
Shebang in studio.sh: #! / Bin / sh You can check if any of the environment variables $ STUDIO_JDK, $ IDE_HOME, $ JDK_HOME, $ JAVA_HOME are found in the file ~ / .profile (and not ~ / .bashrc) previous version of Java.
In my case, I pointed $ JAVA_HOME to the Java 1.7 site. After changing $ JAVA_HOME to a Java 1.8 location, I could start Android Studio again.
Remind me . To reload the ~ / .profile file, it needs to log out and log in.
source share