Maven (i)--install (including Eclipse's maven plugin)

Source: Internet
Author: User

Note: My eclipse is using the latest version of ADT, and last year Google stopped supporting ADT, and most companies are now switching to Android studio.

1, first to the MAVEN official website download Maven,window download "Binary zip" can


2, note: The official website has indicated, did not install the JDK environment must first install the JDK


3, through help, about eclipse can see the version of Eclipse


After the installation is complete, eclipse will ask you to confirm the reboot and the Help menu will have a "ecplise Marketplace" after reboot.


4. Eclipse Install Marketplace plugin, menu bar help, install New software. Plug-in Address is http://download.eclipse.org/mpc/juno/(use the Eclipse Indigo version here, replace the Juno string in the URL based on your eclipse version, note that the first letter is lowercase)

(1) In addition, the names of each version in Eclipse are shown below:

Eclipse has been using Jupiter's satellites as a version name since 3.1, for example:

Europa: Io lo
Ganymede: Europa Europa
Ganymede: Gamma Nimme Ganymede
Callisto: Calisto Callisto

....

Eclipse 3.1 Version Code IO "Europa 1, Yi ao"
Eclipse 3.2 Version Code Callisto "Europa Four, Calisto"
Eclipse 3.3 Version Code Eruopa "Europa, Euro-Europa"
Eclipse 3.4 Version Code Ganymede "Ganymede, Genimide"
Eclipse 3.5 Version Code Galileo "Galileo"
Eclipse 3.6 Version Code Helios "Sun god"
Eclipse 3.7 Version Code Indigo "Indigo"

Seemingly no Eclipse 4.1, the official web site does not see the download link ~ ~

Eclipse 4.2 Version Code Juno "Wedding Star"
Eclipse 4.3 version code Kepler "Kepler"

....

(2) Web landing http://download.eclipse.org/mpc/, you can view the corresponding MPC version information.

(3) Installing the MPC (Marketplace Client)


4, unzip the Apache-maven to the corresponding directory, and set the corresponding environment variables

(1) Set the MAVEN environment variable and print the following after successful setting:

① setting Maven_home for apache-maven storage directory

② add MAVEN's Bin directory to path:%maven_home%\bin


(2) If the JDK environment is not configured, the following error will be reported


Workaround:http://www.myexception.cn/java-other/172921.html

① Right-click My Computer, Properties--Advanced environment variable

② new System Variables Java_home and Classpath

Variable name (N): Java_home
Variable Value (V): C:\Program files\java\jdk1.7.0

Variable name (N): CLASSPATH
Variable Value (V):.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;

③ Select the environment variable named "path" in the "System variables", double-click the variable, add the absolute path of the bin directory in the JDK installation path to the value of the path variable, and use the half-width semicolon and the existing path to separate.
Variable name (N): Path
Variable Value (V):%java_home%\bin;%java_home%\jre\bin;

Java environment variable setting purpose:

①java_home

For the convenience of reference, such as your JDK installed in the C:\Program files\java\jdk1.7.0 directory, then set Java_home as the directory path, then you want to use this path later, just enter%java_home%, Avoid entering a long path string for each reference;

In principle, when your JDK path needs to be changed, you just need to change the value of the Java_home variable, or you will change any document that references the JDK directory with an absolute path, if you do not change it, a program cannot find the JDK, the result may be a program crash;

Third-party software will refer to the agreed-java_home variable, only to be able to use the software, after a long time with Java will know that if a software is not normal use, it is likely that the Java_home settings are not caused;

②classpath

The purpose of setting up the classpath is to find the corresponding ". Class" File for the program, for example: Compiling a Java program---a.java, you will get a A.class class file, execute Java A in the current directory, will get the corresponding result (if you have set
Classpath is "."). Now, moving the A.class to a different directory (for example: "E:\"), executing Java A will throw a Java.lang.NoClassDefFoundError exception because the. class file is not found, and now you add Classpath to: ".; E:\ "Run Java A again, and everything is OK, the Java command found the. class file through Classpath!

③path

Do you want to use%java_home%\bin\java to execute JAVA commands at any time, and of course not, so you can choose to add%java_home%\bin to the path, so that we can execute the command only in Java under any path. (When you enter your code in the Command Prompt window, the operating system looks for the appropriate application in the current directory and path variable directory, and executes.)

5. Open Eclipse Marketplace, search maven, and navigate to "Maven Integration for Eclipse" click Install


Because the marketplace default will provide you with the latest version of the plugin, but ADT has been a long time not updated, so it will be an error


The problem is that the MAVEN version is too high and the eclipse version is too low to be compatible. So we need to find a lower version of Maven. So it can only be downloaded and installed manually offline.

http://http://download.eclipse.org/technology/m2e/milestones/


Back to the way we started installing the software Help--install New software


Once installed, you can see the MAVEN options in Windows, show View, and other, and Maven's sound appears in new Project.



6. After the installation is successful, Maven in Eclipse needs to relocate to the MAVEN directory installed on the window. Location: Selection the installation used to launch MAVEN--installation, Preference, Windows----


In addition, the path inside the User Settings is changed to the local maven path.


In addition, if you want to modify Maven's local warehouse address, you can modify the Apache-maven/conf/settings.xml to change the contents of the <localResponsitory> tag to the appropriate address.


The above is all the installation steps of Mavan.

Maven (i)--install (including Eclipse's maven plugin)

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.