Sunday, 23 December 2018

Installing android studio in ubuntu

Android can be installed in two ways in Ubuntu; one is installing command line tools and other is installing android studio. And installing android-studio is bit easy in windows.
In this blog post I will show you different ways of installing android studio in Ubuntu in steps.

Installing Android studio IDE

Note:
Android studio requires Java Read the blog post for installing Java in Ubuntu Click

1. Download Android studio
Download Android studio for linux
Extract the zip file

$ sudo unzip ~/Downloads/android-studio-ide-* -d /opt/

To launch Android studio

$ cd /opt/android-studio/bin
$ ./studio.sh

2. Download SDK
You need to install some SDK before you jump into building android apps.
Click on Configure -> SDK Manager and install required SDK Platforms

Bonus:
Itwill be hard to change the directory to /opt/android-studio/bin and running ./studio.sh file everytime.
So we will create a link to the studio.sh file $ cd /bin
$ sudo ln -s /opt/android-studio/bin/studio.sh studio
Now you can run$ studio from anywhere in Ubuntu to launch the android studio

Installing android studio command line tools

1. Download command line tools for linux

2. Extract Downloaded zip file in home folder
3. Open/home/username/Android/Sdk/tools/bin/ in terminal and run $ ./sdkmanager to install android sdk

Set the ANDROID_HOME environment variable to the location of your Android SDK installation $ sudo nano ~/.bashrc

export ANDROID_HOME=/home/username/Android/Sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Note: Change the username to respective username of your pc

Enjoy! Working with android


Saturday, 3 November 2018

How to install Oracle Java JDK on ubuntu 18 and set JAVA_HOME

How to install Oracle Java JDK on ubuntu 18 and set JAVA_HOME

This blog post will show step by step procedure to install Oracle java on Ubuntu using PPA.




Step 1: Open terminal (Ctrl + Alt + T OR Ctrl + T)
Step 2: Copy and paste the following command in terminal.
For Java 8


sudo add-apt-repository ppa:webupd8team/java

For Java 11

sudo add-apt-repository ppa:linuxuprising/java

Step 3: Update the packages using following command

sudo apt update

Step 4: Download and install java installer
For Java 8

sudo apt install oracle-java8-installer

For Java11

sudo apt install oracle-java11-installer 

Step 5: To set Default Java version
For Java 8

sudo apt install oracle-java8-set-default

For Java11

sudo apt install oracle-java11-set-default

This will complete your java installation, you can verify your installation with following command

java -version

Bonus:
To change default version of java

sudo update-alternatives --config java

Setting JAVA_HOME

sudo nano /etc/environment

paste

JAVA_HOME="/usr/lib/jvm/java-8-Oracle/jre/bin"