0

Installing Android Studio in Ubuntu 13.04

Posted on Monday, May 20, 2013

Go to http://developer.android.com/sdk/installing/studio.html and download Android studio for linux. It will download a tar file in your Downloads folder. Once downloaded, open Nautilus, navigate to Downloads folder, right click in android-studio-bundle-130.677228-linux and select "extract here".
Now you have a new folder named "android studio". Move this folder to your Home folder.
To run the IDE, open the terminal and type:

cd android-studio/bin
./studio.sh
If you are on Ubuntu default installation, using OpenJava, you will see this warning:

If you press Enter Android studio will start with this window:

Troubleshooting.

Installing Oracle Java SDK:
There are two ways for installing Oracle Java SDK.

First method.

First the easy one. Open the console and type:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Ok, now let's check the java version installed. Type:
java -version
and you should see something like:
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

Second method:

Go to http://www.oracle.com/technetwork/es/java/javase/downloads/index.html and download Java JDK. Be sure to download the tar.gz corresponding to your architecture (Linuxx86 or Linuxx64).
Uncompress the file:
tar -xvf jdk-7u21-linux-i586.tar.gz (32bit)
tar -xvf jdk-7u21-linux-x64.tar.gz (64bit)
Now let's move the uncompressed folder to /usr/lib
sudo mkdir -p /usr/lib/jvm
sudo mv ./jdk1.7.0_21 /usr/lib/jvm/jdk1.7.0
Now run in terminal:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1
Change ownership and permissions:
sudo chmod a+x /usr/bin/java
sudo chmod a+x /usr/bin/javac
sudo chmod a+x /usr/bin/javaws
sudo chown -R root:root /usr/lib/jvm/jdk1.7.0
run:
sudo update-alternatives --config java
and choose the option corresponding to /usr/lib/jvm/jdk1.7.0/bin/java
do the same for
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
Now check the version with
java -version

Discussion

Leave a response