Skip to content

On linux there are a few different favors of Java. there are atleast two that we are aware of. One from Oracle and a second from opensource community which is called OpenJDK. For some reason, we like to do this old fashion way. Therefore, we will install JDK from oracle.

As of this writing, there is this release of JDK 1.8.91 and 1.8.92.

  1. download the latest JDk from oracle:
    1. JDK 1.8.92/91
    2. download either the *.*.91 or *.*.92 edition
    3. save it somewhere on your machine
    4. its weird how we do this but other software are doing this as well so we are following them.
    5. sudo cp jdk-8u92-linux-x64.tar.gz /opt
    6. cd /opt
    7. sudo tar xzvf jdk-8u92-linux-x64.tar.gz
    8. sudo chown -R root:root jdk1.8.0_92/
      1. you can make it own by your username which is fine too, root should be ok, otherwise,
      2. sudo chown -R yourusername:yourusername jdk1.8.0_92/
    9. cd /usr/bin
    10. sudo ln -s /opt/jdk1.8.0_92/bin/java java
    11. sudo ln -s /opt/jdk1.8.0_92/bin/javac javac
    12. DONE !

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 studio.sh.

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 android-studio-ide-143.2821654-linux.zip /opt
flo@hashirama:~/Downloads $ cd /opt
flo@hashirama:/opt $ sudo unzip android-studio-ide-143.2821654-linux.zip
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--

Screenshot_2016-06-03_22-51-22

first, download and utilize IntelliJ IDE for all Java development. we assumed that you've already installed a favor of ubuntu onto a desktop/laptop device. We are using a small version of Kubuntu, which is xubuntu . It is supported until sometime 2020 just like all the other *buntu favor of linux distributions.

  1. download: https://www.jetbrains.com/idea/#chooseYourEdition
  2. select the community version
    1. the enterprise version is highly robust and suits for professional Java developers, but its only for 30 days for everyone else unless you plan to fork out funds for this enterprise version or that  you have a userName@School.edu  college/university email address.
  3. We saved it onto Download folder.
  4. cd Downloads
  5. cp ideaIC-2016.1.2b.tar.gz ..
  6. tar xzvf ideaIC-2016.1.2b.tar.gz
  7. cd idea-IC-145.972.3
  8. ./bin/idea.sh &
  9. Follow the intstructions on the menu and go from there. Choose Dracula theme, its KOOOOOOOL.
  10. There is an issue with iBUS not being kool with something, do this onto your .bashrc file
    1. vim .bashrc
    2. export IBUS_ENABLE_SYNC_MODE=1
    3. source .bashrc

Screenshot_2016-06-02_21-31-08

Greetings,

If its all possible, we will try to keep up with this blog on a monthly basis, by adding new contents on topics related to technology, programming and engineering. we will also be posting contents which we believed to be important in the world of technology.  Aside from this, there will certainly be some random contents where it may also be worth posting from varous colleagues or contents  which have been bought to our attention.

Our focuses will be on Opensource applications, Linux Operating Systems and   topics related to Programming, particularlly data processing.

warm Regards,

kraeftigerkaese.net