Configuration of MAC Android development environment variables (Java, SDK, NDK, Gradle)

Source: Internet
Author: User

1. Open Terminal
2. Then enter

VI. Bash_profile Press "E" to enter edit mode

3. Enter the environment variables you want to configure (Java, SDK, NDK, Gradle):

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export ANDROID_HOME=/Users/jingbin/Documents/AndroidStudio/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

export PATH=$PATH:/Users/jingbin/Documents/AndroidStudio/ndk/android-ndk-r10e
export A_NDK_ROOT=/Users/jingbin/Documents/AndroidStudio/ndk/android-ndk-r10e

export GRADLE_HOME=/Applications/Android\ Studio\ 2.app/Contents/gradle/gradle-2.14.1
export PATH=$PATH:$GRADLE_HOME/bin

4. Using the VI Editor

Esc
: Wq
Save and exit (Note the ":" number)

5. Update settings

source. bash_profile

6. Check that the corresponding configuration is successful

echo $PATH (view path)
Java-version
adb
Ndk-build
Gradle-version

Configuration of MAC Android development environment variables (Java, SDK, NDK, Gradle)

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.