Install JDK and Android Studio under ubuntu16.04

Source: Internet
Author: User

1 first download the corresponding Linux JDK version on the JDK website. After entering the website, first select Accept License Agreement and then download. My Linux system is Ubuntukylin 16.04 64-bit, so choose 64-bit system downloads.

2, and then use the command to switch paths Cd/usr/lib

3. Create a folder in this directory sudo mkdir JVM

4, enter the default download directory home/download/Extract Files (tar-zxvf jdk-8u91-linux-x64.tar.gz)



5-Cut to download directory (cd ~/download), use command sudo mv JDK1.8.0_91/USR/LIB/JVM to move JDK to/USR/LIB/JVM directory


6 Next Configure the system environment variable, where the environment variable is configured in Etc/profile, that is, configure the JDK environment for all users, open the/etc/profile file with command sudo gedit/etc/profile, and add the following lines at the end

#set Java Environment
export java_home=/usr/lib/jvm/jdk1.8.0_91 
export JRE_HOME=${JAVA_HOME}/JRE  
Export Classpath=.:${java_home}/lib:${jre_home}/lib  
export path=${java_home}/bin: $PATH


7, configure the soft connection, the execution code is:

sudo update-alternatives--install/usr/bin/java java/usr/lib/jvm/jdk1.8.0_91/bin/java-   
sudo Update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/jdk1.8.0_91/bin/javac 300  
Java-version
Java  
Javac

--------------------------------------------Android Studio--------------------------------------------------------------

2, download the android Studio package (download link http://www.android-studio.org/or http://tools.android-studio.org/choose the appropriate download)

Android-studio-ide-143.2821654-linux.zip
Extract:
The folder name is Android-studio after decompression.
Move: sudo mv android-studio/opt/
Open folder: cd/opt/android-studio/bin/
Run: sudo./studio.sh
OK, open it.

3. Try a new test project.
After the first new project will be prompted to download Gradle, this is the Android studio must be part of a long time, slowly wait. Terminal prompts are as follows:
Downloading Http://services.gradle.org/distributions/gradle-1.9-all.zip

4 plug in the phone to run the discovery can be used

After 5 you want to run the Android studio directly at the command prompt, enter

sudo/opt/android-studio/bin/studio.sh


Since my first contact with Ubuntu and Android Studio can only be used for the time being, it will continue to improve

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.