I have installed Android Studio and I followed all steps described here
But when I start studio.sh
I got an error with this message:
You have 2 things you must check:
/etc/environment
file has the correct JAVA_HOME
and PATH
values referring to your Java installation directory. sudo apt-get install default-jdk
That's all in ubuntu 11
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
Widows 7 64 bit.
in OpenSuSE 13.1 and some 13.2 versions you also need to:
java-1_7_0-openjdk-devel
packageFor x86:
JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0/ sh studio.sh
For x64:
JAVA_HOME=/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/ sh studio.sh
First check if the Java JDK is installed correctly:
dpkg --list | grep -i jdk
If not, install the JDK:
Download the latest version of the JDK from Oracle: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Extract it to the appropriate location in your machine. Get the extract location:
vi ~/.bashrc
or vi ~./ bash_profile
JAVA_HOME=/home/user/installs/jdk1.7.0_40
PATH=$JAVA_HOME/bin
source ~/.bashrc
or source ~/.bash_profile
After the installation you can check it:
java -version
which java
If all things are correct then the right the answer should be something like this:
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
Append the following statement to studio.sh the file in android-studio/bin directory:
JAVA_HOME=/home/user/installs/jdk1.7.0_40
Finally start your Android Studio with the following command:
./studio.sh