Install android studio in linux
Recently, I want to use android programming. I originally wanted to install eclipse. I accidentally found android studio, a development tool, and planned to install it for trial.
Http://www.android-studio.org/
Download android studio
Windows, Mac OS X, and Linux
I'm running linux.
Android-studio-ide-135.1629389-linux.zip
Extract
Unzip android-studio-ide-135.1629389-linux.zip
Sudo mv android-studio/opt/
Cd android-studio/bin/
./Studio. sh
There is an error message indicating that JAVA_HOME is incorrect.
Print its value
Echo $ JAVA_HOME
Yes
/Usr/lib64/jvm/jre
$ JAVA_HOME points to jre. No, this should point to JDK, so you need to install and configure JDK
From the URL below
Http://www.oracle.com/technetwork/java/javase/downloads/index.html
Download JDK
My 64-bit suse is used to download the x64 version.
Jdk-8u40-linux-x64.tar.gz
Note that it is best to run tar. The rpm I use will prompt an error.
Jdk-8u40-linux-x64.rpm
Install
Rpm-ivh./jdk-8u40-linux-x64.rpm
Error: dependency check failed:
/Usr/sbin/alternatives required by jdk1.8.0 _ 40-2000. 8.0 _ 40-fcs.x86_64
Sudo tar-xvf./jdk-8u40-linux-x64.tar.gz-C/opt/java/
Set Environment Variables
In ~ /. Add to bashrc
# Set java environment
JAVA_HOME =/opt/java/jdk1.8.0 _ 40/
CLASSPATH = $ JAVA_HOME/lib/tools. jar
PATH = $ JAVA_HOME/bin: $ PATH
Export JAVA_HOME CLASSPATH PATH
Modify the system's default java:
Sudo update-alternatives -- install/usr/bin/java/opt/java/jdk1.8.0 _ 40/bin/java 300
Sudo update-alternatives -- install/usr/bin/javac/opt/java/jdk1.8.0 _ 40/bin/javac 300
Sudo update-alternatives -- config java
Sudo update-alternatives -- config javac
Run./studio. sh again.
It will always be stuck in "Fetching Android SDK component information"
1) Go to the bin directory under the installed Android Studio directory. Find the idea. properties file and open it in a text editor.
2) add a line at the end of the idea. properties file: disable. android. first. run = true, and then save the file.
3) Close Android Studio and restart to enter the interface.
There is a "start a new Android studio project" option when you enter android studio. When you click this option, nothing happens.
This is because the SDK path is not set,
Http://www.android-studio.org/
Download SDK TOOLS FOR ANDROID STUDIO
I got a android-sdk_r24-linux.tgz.
Sudo tar-xvf android-sdk_r24-linux.tgz-C/opt/
To
Http://www.cnblogs.com/bjzhanghao/archive/2012/11/14/2769409.html
Download platform-tools_r14-linux.zip (this website only downloads this version)
Unzip platform-tools_r14-linux.zip
Sudo mv platform-tools/opt/android-sdk-linux/
~ /. Add to bashrc
PATH =/opt/android-sdk-linux/tools:/opt/android-sdk-linux/platform-tools: $ PATH
Export PATH
Go to Configure --> Project Defaults --> Project Structure under Android studio and set the path to/opt/android-sdk-linux.
In this way, you can create a project.
If you want to use a simulator on your computer, you need a corresponding version of the system image file. If you only debug the program on a real machine, you do not need to download the simulator rom.
The first method is to directly install the sdk manager in android studio. If this method fails (it is difficult to connect to the official website), you can manually download the installation package (you can use Baidu search)
Sysimg installation method is in the root folder of your SDK directory
Decompress the file to this directory. .
I chose android v4.03 corresponding to version 15, so I chose to download sysimg_armv7a-15_r02.zip
I am
Http://dl.vmall.com/c01mrjmpu3
Download
Sysimg_armv7a-15_r02.zip
Mkdir/opt/android-sdk-linux/system-images/android-15
Unzip sysimg_armv7a-15_r02.zip
Music armeabi-v7a // opt/android-sdk-linux/system-images/android-15/
Because of the wall, some resources are not easy to download and install through the official website, and can only be found on the website. The installation process is a bit tortuous, but it is finally completed.
Author: handsome, dare not go out, programmer group: 31843264