Environment variables, maven3.1.1 and jdk1.7.0.45 configuration under Mac

Source: Internet
Author: User

I. Setting environment variables

1. Open terminal, enter CD ~

2. Enter Touch. Bash_profile (If the file does not exist, an empty file will be created)

3. Enter Open. Bash_profile (call Notepad to edit the file)

Ii. Settings for Maven 3.1.1

In the. bash_profile file, refer to the following statement:

Maven_home=/usr/share/java/maven-3.1.1export Maven_homeexport Path=${path}:${maven_home}/bin

Note:

A) Download the latest maven from MAVEN's website (3.1.1 in this article), unzip it to the/usr/share/java/maven-3.1.1 directory, and if you are not, adjust the path in the first row

b) in the Finder, navigate to/usr/share/, remove the MAVEN alias (alias-Windows-like shortcut) (after installing Xcode, the MAVEN 3.0.3 environment is configured by default), and then create a "/usr/share/ java/maven-3.1.1 "Alias (How to: Right-click on the maven-3.1.1 directory, create an alias), alias name is still changed to Maven, and finally copied to/usr/share/, the purpose is to replace maven this" shortcut " The path pointed to is the latest path

Detection method: Restart the terminal input echo $MAVEN _home, under normal circumstances, you can see the directory output MAVEN, and then enter Mvn-version, if you see the version is 3.1.1, indicating that the configuration takes effect.

Third, the configuration of jdk1.7.0.45

Download the latest JDK from Oracle website (currently 1.7.0.45) after installation, although the terminal command line Java-version, the version shown is already 1.7, but does not automatically set Java_home environment variables, step two, if the input mvn-version Detection, see the JDK may still be 1.6, or according to just the idea, open. Bash_profile, change to the following:

maven_home=/usr/share/java/maven-3.1.1java_home=/library/java/javavirtualmachines/jdk1.7.0_45.jdk/contents/ Homeexport Maven_homeexport Java_homeexport Path=${path}:${maven_home}/bin:${java_home}/bin

Environment variables, maven3.1.1 and jdk1.7.0.45 configuration under Mac

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.