Skip to content

Install Android-Studio on ubuntu 16.04

This one is pretty tricky due to the natur and difficulty in installing various components for the linux OS and Java. We assumed that you have installed *buntu 64 bit OS, it doesnt matter which favor you have installed as long as its 64 bit. If you have installed JDK and Android Studio but couldnt get it to work. This may or may not assist you in getting android studio onto your linux machine but may provide some incite to your issues. We believed this will work for users who have NOT initially installed Android Studio onto their system. Not 100% guaranteed that this will install properly the first time. If you are fed up with this, we recommend using windows instead. Point and click, the installation package will be much simpler.

Disclaimer: **Experience and knowledge in linux admin/engineering and java installation subject matter came at a tremendous expense. Also, bare in mind that someone who has installed JDK/Android-Studio on this linux distro, which was just recently released is pretty dam good at what they do and skillful in understanding how to troubleshoot issues.**  Sadly, trial and error may not work in this case.

The interesting thing was that there were so many methods in installing this application onto a linux machine but some of the methods did not worked for us yet simple too. Our first method was simply to include a third party repo from here Android Repo but we found that openJDK not allow to write over itself for some reason. We then scrap this approach and use our judgement and to simply manually install Android Studio using a second method.

The installation from Android Website is slightly different than what we came up with.

First check to see if you have installed jre and jdk by doing the following:

flo@hashirama:~$ sudo dpkg -l | grep -i jdk
ii openjdk-9-jdk:amd64 9~b114-0ubuntu1 amd64 OpenJDK Development Kit (JDK)
ii openjdk-9-jdk-headless:amd64 9~b114-0ubuntu1 amd64 OpenJDK Development Kit (JDK) (headless)
ii openjdk-9-jre:amd64 9~b114-0ubuntu1 amd64 OpenJDK Java runtime, using Hotspot JIT
ii openjdk-9-jre-headless:amd64 9~b114-0ubuntu1 amd64 OpenJDK Java runtime, using Hotspot JIT (headless)

if you do have something like those already preinstalled, removing it will help but we are not 100% certain since all android-studio really is seeking was JDK. The problem for us was that the installation would not function without removing all of the preinstalled jre and jdk stuff. If you have a software dependency where some existing software required openJDK, perhaps you should consider stopping here and use window instead or you can try to continue and see, since we believed that the installation of openJDK may not seem to matter afterall. The first approach was highly complicated. The second approach may just be three commands then execute

so.. let us remove JRE and jdk
flo@hashirama:~$ sudo apt-get autoremove openjdk-9-jdk
flo@hashirama:~$ sudo apt-get purge openjdk-9-jdk
flo@hashirama:~$ sudo apt-get autoremove openjdk-9-jdk-headless
flo@hashirama:~$ sudo apt-get purge openjdk-9-jdk-headless
flo@hashirama:~$ sudo apt-get autoremove openjdk-9-jre
flo@hashirama:~$ sudo apt-get purge openjdk-9-jre
flo@hashirama:~$ sudo apt-get autoremove openjdk-9-jre-headless
flo@hashirama:~$ sudo apt-get purge openjdk-9-jre-headless
flo@hashirama:~$ cd /var/cache/apt/archives/
flo@hashirama:~$ sudo rm -f openjdk-9-*.deb

so.. updating and installing the required packages
flo@hashirama:~$ sudo apt-get update
flo@hashirama:~$ sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0:i386 lib32stdc++6 build-essential

Installation Process

flo@hashirama:~$ sudo apt-get install openjdk-9-jdk
flo@hashirama:~$ sudo dpkg --configure -a
flo@hashirama:~$ sudo dpkg -i --force-overwrite '/var/cache/apt/archives/openjdk-9-jdk_9~b114-0ubuntu1_amd64.deb'

so.. linking java and javac, this is the part where we believed makes all that stuff from above meaningless as long as you have
installed oracle JDk in /opt and the C libraries in that one line to install packages, Andorid-studio seem to be looking for the Clibs and Java mainly.

flo@hashirama:~$ cd /usr/bin
flo@hashirama:~$ sudo ln -s /opt/jdk1.8.0_92/bin/java java
flo@hashirama:~$ sudo ln -s /opt/jdk1.8.0_92/bin/javac javac

now download Android-Studio

so.. putting this application in /opt since it is a third party software
flo@hashirama:~/Downloads $ sudo cp /opt
flo@hashirama:~/Downloads $ cd /opt
flo@hashirama:/opt $ sudo unzip
flo@hashirama:/opt $ cd ./android-studio/bin
flo@hashirama:/opt/android-studio/bin $ ./studio &

Holy Cow ! If you see a screen popped up and its not your imagination, pat yourself on the back and go grab yourself a cheesecake.
we are Done !

It should be functional by now, just follow the screen instructions to continue with the rest of the Android internal packages.

# special section where it may just simply work, yet we dont know.
It might possibily be as easy as the following steps:
flo@hashirama:~$ sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0:i386 lib32stdc++6 build-essential
Read my other post in downloading and installing JDK from oracle
now download Android-Studio
Install this studio using the instructions from above.

--Happy Coding--


Leave a Reply

Your email address will not be published. Required fields are marked *