Ubuntu19 builds Flutter development environment: 1, Android Studio

Install Android Studio on Ubuntu

Android Studio is the official IDE for Android application development. In this tutorial, you will learn how to install Android Studio on Ubuntu 18.04.

How to install Android Studio on Ubuntu 18.04

Requirements

Before starting to install Android Studio on Ubuntu 18.04. You must have a non-root user account with sudo privileges on the desktop. In this tutorial, you will learn how to install Android Studio on Ubuntu.

Before you start

You should install Java on the Ubuntu desktop. If you have not installed Java on your desktop, please use the following instructions to install it (you can also refer to https://www.linuxidc.com/Linux/2018-12/155943.htm ), or if it is already installed, please skip to the next step .

To check whether Java is installed, enter the following command.

java -version

To check if Java is installed

1. Install Java in Ubuntu

First, you need to add the repository to install Java in Ubuntu. Add the repository by typing the following in the terminal

linuxidc @ linuxidc: ~ / www.linuxidc.com/ Linux Corporation $ sudo add-apt-repository ppa: linuxuprising / java

Now update the package manager index by typing the following.

sudo apt update

Type the following command to install Java.

linuxidc@linuxidc:~/www.linuxidc.com/Linux公社$ sudo apt-get install Oracle-java11-installer

Here, you will be asked to accept the Oracle license agreement. After the installation is complete, you need to set the JAVA_HOME path on Ubuntu 18.04.

After the installation is complete, Oracle Java 11 should be automatically set to the default value. If not, run the command

linuxidc@linuxidc:~/www.linuxidc.com/Linux公社$ sudo apt-get install oracle-java11-set-default

 

Check your java version through java -version and javac -version:

linuxidc@linuxidc:~$ java -version
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
linuxidc@linuxidc:~$ javac -version
javac 11.0.1

JDK and Eclipse installation and configuration under Ubuntu 18.04

Write a hello world to test the following:

nano linuxidc.java, the contents are:

public class linuxidc{
    public static void main(String[] args){
        System.out.println("Hello World!Linux公社www.linuxidc.com");
    }
}

Then execute

linuxidc@linuxidc: ~ / www.linuxidc.com/ Linux Corporation $ javac linuxidc.java
linuxidc @ linuxidc: ~ / www.linuxidc.com/ Linux Corporation $ java linuxidc
Hello World! Linux Corporation www.linuxidc.com

 

 

2. Install Android Studio using PPA

In order to install Android Studio on Ubuntu 18.04, we need to add the repository. Then we need to update the package manager index. After this, you can install Android Studio in Ubuntu.

To add the repository from where you want to install Android Studio, enter the following command.

sudo add-apt-repository ppa:maarten-fonville/android-studio

Update the apt package manager index by typing the following in the terminal.

sudo apt update

The following commands are used here. Android Studio will be downloaded from the Google server and then will be installed.

sudo apt install android-studio

After successful installation, go to the activity search Android Studio. Then click it to start.

If you do not find the Android Studio icon, please run the following command to add one.

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

Search again and start it. You will be asked to import the previous settings.

If you "cannot access the Android SDK add-on list" error, you need to set up a proxy.

Set up manual proxy configuration, then set the port number to 1080 and the host name to 127.0.0.1

Now, you will be prompted to install Android SDK tools, platform tools, etc.

Install it and start coding with android studio.

 

The above is reproduced from:

JDK and Eclipse installation and configuration under Ubuntu 18.04

 

3 Install Android SDK

Open Android Studio manually and install the latest SDK and emulator according to the wizard installation number. The character is better today, and the download is over soon.

Guess you like

Origin blog.csdn.net/qq_27158179/article/details/91049905