MAC Configuration Environment variables (java,android,maven,hosts)

Source: Internet
Author: User

Java_home
    • Configuring Environment variables

      # 使用vim打开.bash_profile文件,加入java环境变量$ vim .bash_profileexport JAVA_HOME=$(/usr/libexec/java_home)
    • Check if successful

      $ source .bash_profile$ echo $JAVA_HOME $ java -version
Android_home
    • Configuring Environment variables

      $ vim .bash_profile export ANDROID_HOME=/Applications/ADT/sdkexport PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
    • Check if successful

      $ source .bash_profile$ echo $ANDROID_HOME $ adb
Maven_home:
  1. Use Brew to download and configure

    $ brew install maven
  2. Normal configuration maven:

    • Download from official website
      maven:http://maven.apache.org/

    • Unzip and copy the downloaded Maven Move to the directory you want
      For example:/usr/local/maven

    • Configure environment variables

        $ vim. Bash_profileexport maven_home=/usr/ Local/maven/apache-maven-x.x.xexport path= $MAVEN _home/bin: $PATH  
    • Check for success:

        $ source. bash_profile$ Echo $MAVEN _home$ mvn-version  
  3. Other

    • To reset the local repository location:

      # 在maven安装目录的conf目录下:$ vi settings.xml添加:<localRepository>具体的绝对路径</localRepository>
    • To configure the agent:
      Modify the Settings.xml file under the ~/.m2 folder, and if not, copy it to the maven_home/conf directory.

      <settings>    ...      <proxies>        <proxy>          <active>true</active>          <protocol>http</protocol>          
Hosts
    • To modify using the command line:

    • Manual modification:
      Open finder->go-> Input:
      /private/etc/hosts

MAC Configuration Environment variables (java,android,maven,hosts)

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.