After ./studio.sh
in a terminal I get this error \"tools.jar is not in android studio classpath Please ensure JAVA_HOME
points to JDK rather than JRE\"
I have figured it out. You need to install openjdk-jdk. Opensjdk-jre is not enough. So in terminal all you need to do is write sudo apt-get install openjdk-7-jdk
then press yes. Open the android studio bin folder, double click on studio.sh, open in terminal, press enter, and then android studio should work.
the solution for me was to modify studio.sh and add JAVA_HOME as a variable:
# ---------------------------------------------------------------------
# Locate a JDK installation directory which will be used to run the IDE.
# Try (in order): STUDIO_JDK, ../jre, JDK_HOME, JAVA_HOME, "java" in PATH.
# -------------------------------------------------------------------
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-i386/
if [ -n "$STUDIO_JDK" -a -x "$STUDIO_JDK/bin/java" ]; then (etc..)
This below trick work for me , Check your app dependencies in build.gradle(Project:AppName) .
Try the latest build.gradle version.
classpath 'com.android.tools.build:gradle:2.2.1'
You have to have the latest JDK. I solved it by
sudo apt-get install openjdk-8-jdk
(Note the '8' in there)
This is what I did to solve the problem:
cd /opt/ (where android-studio directory is located)
sudo chown -R your_user:your_user android-studio
(where your_user is... yes your username :) )
This seems like permission problem. Someone who packed Android Studio, has the original files under non-root account. If you unpack it as root, the files and dirs has no permission for "other" (just for owner). The person who is packing Android Studio knows a lot about Android and Java, but not much about Unix permissions (uch!). There are two possible solutions:
a) unpack android-studio-bundle-...-linux.tgz as normal user, not as root (this has an advantage - you will be able to update Andriod Studio by clicking menu; but this is generally stupid because you are open to malware attack)
b) fix read permissions for files and dirs for whole android-studio directory with something like: chmod -R +r /opt/android-studio