How to Install Android Studio Linux Style
As a Linux enthusiast and a newcomer to Android development, I am excited to present you with a tutorial on setting up the best Android Dev tool on the best operating system, Linux Mint!
To be fair, I don’t know of any other Android Development tools. But I am in love with Linux Mint. That part is 100% true
This tutorial will span 3 parts: Installing the Java JDK, Installing Android Studio, and setting up to create an application. Click images to see them in their full size during the tutorial. Let’s start!
PART 1: Java JDK Installation
- First remove your openJDK installation so that you can install the appropriate version of Java for Android Development.
-
- Open the Terminal
- Type su to become a superuser
- Enter your password at the prompt
- Type: sudo apt-get update && apt-get remove openjdk*
- Type Y for yes
- The installation process will now take place.
-
- Download the Oracle JDK here.
-
- Be sure to select the Linux version containing a tar.gz extension for this tutorial.
- Accept the License Agreement before downloading
- Remember, select x86 if your computer has a 32-bit CPU and x64 for a 64-bit CPU otherwise you will not be able to install the Oracle JDK properly!
-
- In the Terminal window, navigate to your downloaded file using the cd command
- cd Downloads/
- Using the terminal, extract the necessary files from the downloaded file using the tar command.
- tar -zxvf jdk-8u101-linux-x64.tar.gz
- Since we typed the su command to become a superuser in the start of the tutorial, we have the permissions necessary for creating directories for the Oracle JDK in the next few steps. Create a directory in the /opt directory where your java jdk will be stored and referenced later on
- mkdir -p /opt/java
- Move your jdk folder to the directory you created in Step 5
- mv jdk1.8.0_101/ /opt/java/
- The next two commands will make your new JDK the system default. When we install Android Studio, it will automatically recognize this installation.
- sudo update-alternatives –install “/usr/bin/java” “java” “/opt/java/jdk1.8.0_101/bin/java”
- sudo update-alternatives –set java /opt/java/jdk1.8.0_101/bin/java
- For the final step, test the installation with this command to ensure everything installed properly
- java -version
Part 1 is finally complete! Take a breath of fresh air, stretch, and get ready for Part 2! To return to your regular user privileges, type the command exit into the terminal. Switch back to root at any time by typing su and entering your password at the prompt.
PART 2: Downloading the Android Studio Repository
- Once again, we will be returning to the Terminal. Fire it up and enter the following command to download the Android Studio repository. Enter your password if it prompts you to do so.
- sudo apt-add-repository ppa:paolorotolo/android-studio
- enter your password
- When that is finished, update all of your repositories (including the freshly downloaded Android Studio repository) with the following command:
- sudo apt-get update
- Finally, use this last command to install the Android Studio application
- sudo apt-get install android-studio
- When this is done, log out and log back in to see the changes complete. (I recommend restarting, but logging out should suffice)
Part 2 complete! Boy this process gets easier as you work through it.
PART 3: Setting up an Android Application
- This last part is very straightforward. Startup Android Studio and allow the project files to load completely.
- Click “Start a new Android Studio project”.
- The Application Name is the name your app will have in the Play Store. The Company Domain is your website. Fill this field with the address of your website or leave it as the example provided. Click Next.
- Select “Phone and Tablet”. I recommend selecting Android 4.0.3 IceCreamSandwich or higher as your Minimum SDK to ensure your application is compatible with the most devices while maintaining the highest speed. Click Next
- Select “Basic Activity” as your Activity. Click Next, and Finish on the next screen as well.
Congratulations! You have now successfully installed Android Studio and are well on your way to becoming an Android Developer! Thanks for checking out the tutorial, let me know if you have any questions comments or concerns in the box below!
Join the mailing list to see updates like this every week!
Coding Fanatic
Follow me on Twitter @rclarkecf for more content daily!