Android Studio is an Integrated Development Environment (IDE) for developing Android applications based on IntelliJ IDEA. Android Studio is a free and open source tool. It provides tools to build apps on every Android device.
In this article, we will learn how to install Android Studio on CentOS 7.
Installation Android Studio on CentOS 7
You need to install JDK 1.6 or later. Remember to use 'sudo' before the commands if you are not a root user. You can download the latest version of JDK. In case you already have an older version installed, remove the same before installing the new one.
I will be installing JDK version 1.8.0_65 by downloading the required rpm.
$ sudo rpm -ivh jdk-8u65-linux-x64.rpm
If Java path is not set properly, you will get error messages. Hence, set the correct path:
export JAVA_HOME=/usr/java/jdk1.8.0_25/ export PATH=$PATH:$JAVA_HOME
Check if the correct version has been installed:
# java -version java version "1.8.0_65" Java(TM) SE Runtime Environment (build 1.8.0_65-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
If you notice any error message of the sort "unable-to-run-mksdcard-sdk-tool:" while trying to install Android Studio, you might also have to install the following packages on CentOS 7 64-bit:
glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 libXrandr.i686
Let us now install studio by downloading the ide file from Android site and unzipping the same.
# unzip android-studio-ide-141.2343393-linux.zip
Move android-studio directory to /opt directory
# mv /tmp/android-studio/ /opt/
You can create a simlink to the studio executable to quickly start it whenever you need it.
# ln -s /opt/android-studio/bin/studio.sh /usr/local/bin/android-studio
Now launch the studio from a terminal:
When the installation completes, you can start creating your own Android applications.
Installing Andriod Studio Using Snap package
If you are running CentOS 7.6+ or Red Hat Enterprise Linux 7.6, then you can use snap package to install android studio.
First add EPEL repo:
$ sudo yum install epel-release
Install snap using yum:
$ sudo yum install snapd
Enable snap communication socket:
$ sudo systemctl enable --now snapd.socket
To enable classic snap support, type:
$ sudo ln -s /var/lib/snapd/snap /snap
Finally, to install android studio using snap, type
$ sudo snap install android-studio --classic
Within a year of its release, Android Studio has taken over as the primary IDE for Android development by eclipsing Eclipse. It is the only official IDE tool that will support future Android SDKs and other Android features that will be provided by Google. So, what are you waiting for? Go install Android Studio and have fun developing Android apps.