Mac-side Android development environment (Android studio) configuration

Mac-side Android development environment (Android studio) configuration

Install and configure JAVA (jdk)

The version I installed here is java16. There are two installation methods, manual installation from the official website or easy installation.

  1. manual installation

    • First download java from [Oracle official website] https://www.oracle.com/java/technologies/javase-downloads.html

    • Copy the download folder to the target foldercp java16 /Library/Java/JavaVirtualMachines/

    • Configure environment variables, open -e ~/.bash_profile, add the following Java configuration lines to the file, then save and close the window and enter in the terminalsource .bash_profile

    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk16/Contents/Home
    PATH=$JAVA_HOME/bin:$PATH:.
    CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
    export JAVA_HOME
    export PATH
    export CLASSPATH
    
    • Finally check whether the installation is successfuljava -version
  2. Of course, you can also use brew to install java
    brew install java

Install and configure maven

You can download and install from the official website or use brew to install directly, but here is a reminder! remind! remind! The java version of the maven link I installed using brew is not the configured system default version! ! !

1. Official website installation http://maven.apache.org

Put the decompressed folder in the /usr/local/maven directory

cd /usr/local/
sudo mkdir maven
cd maven
sudo cp -r /你自己的下载目录/apache-maven-3.8.1 ./

Configure environment variables. Similarly open -e ~/.bash_profile, add the following configuration to the file

export M3_HOME=/usr/local/maven/apache-maven-3.8.1
export PATH=$M3_HOME/bin:$PATH

export PATH=/Users/lixiaohan03/thirdparty/apache-maven-3.8.1/bin:$PATH

Then check whether the installation is successful

mvn -version

2. brew installation

brew install mvn

After the installation is complete, check whether the installation is successful

mvn -version

At this time, there may be an inconsistency between the java version of the mvn link and the java version of the system configuration, so we need to change the JAVA_HOME in the mvn/conf/setting file and the mvn.cmd file under mvn/bin

Install and configure Android Studio

1. Download the Android Studio installation package from the official website

https://developer.android.com/studio

2. Follow the guide steps to install. If the last step of the installation fails to download, you can choose to manually download the SDK package from the official website, but the version after manual download here does not work. It is recommended to change to a normal network

3. I have the problem that the android studio does not display the window when it is installed. According to the known issues on the official website, the first two configurations can be displayed https://developer.android.com/studio/known-issues

Guess you like

Origin blog.csdn.net/Lolita_han/article/details/128828756