Steps and notes for integrating Maven with eclipse

Source: Internet
Author: User
Tags sonatype

1. Install maven on the operating system.

Maven download page: http://maven.apache.org/download.html


Maven is similar to Tomcat. After downloading it, decompress it and install it in the specified directory. However, Maven has one more environment variable configuration than tomcat.


The current version 3.0.3. Decompress the downloaded file,

First, create a system variable m2home. The variable value points to the maven decompression directory ,:

Set the bin directory to the Windows PATH environment variable. Add % m2home % \ bin to the path system variable ,:

Test whether the installation is successful: Enter

MVN-version

If the installation is successful, the output is as follows:

2. Install the maven plug-in of eclipse

Install the maven plug-in m2eclipse of Eclipse.

M2eclipse plug-in Web site: http://m2eclipse.sonatype.org/installing-m2eclipse.html

Online update website via Eclipse: m2eclipse Core update site:

Http://m2eclipse.sonatype.org/sites/m2e

The procedure is the same as installing other plug-ins.

(

When installing the maven plug-in on eclipse today, the following error occurs:

cannot complete the install because one or more required items cocould not be found.
software being installed: Maven integration for eclipse (required) 0.12.1.20110112-1712 (Org. maven. IDE. eclipse. feature. feature. group 0.12.1.20110112-1712)
missing requirement: Maven integration for eclipse (editors) 0.12.1.20110112-1712 (Org. maven. IDE. eclipse. editor 0.12.1.20110112-1712) requires 'bundle Org. eclipse. zest. core 0.0.0 'But it cocould not be found
cannot satisfy dependency:
from: Maven integration for eclipse (required) 0.12.1.20110112-1712 (Org. maven. IDE. eclipse. feature. feature. group 0.12.1.20110112-1712)
to: Org. maven. IDE. eclipse. editor [0.12.1.20110112-1712]

 

I feel that the Eclipse plug-in is less dependent on maven. I checked it online and the solution is as follows:

 

Start eclipse, click window --> preferences --> install/update --> available software sites, and click Add

Add the following information:

GF http://download.eclipse.org/tools/gef/updates/releases/

Then reinstall the maven plug-in.

)

 

Note: After installation, You need to integrate Maven with the locally decompressed Maven. You need to modify the following two items:

First, window-preferences. The window is displayed:

Second, the real integration action:

3. When eclipse is started, the system prompts "warning": the JDK cannot be found. solution:
Add the following lines to the eclipse.ini(eclipse.iniin the eclipseinstallation directory (vmindicates the location of javaw.exe, or directly go to the bin ):

-VM

C: \ Program Files \ Java \ jdk1.6.0 _ 06 \ bin \ javaw.exe

Note the following points:

Note: Two lines must be written, and one line cannot take effect.

Note: These two lines must be before-vmargs, otherwise they will not take effect.

Note: The last line can also be written as C:/program files/Java/jdk1.6.0 _ 16/bin/

4. the prompt "unable to locate the javac compiler in" is displayed:

Solution:

Window-> preferences-> JAVA-> installed jres, click "add", select the default "Standard VM", and click "next> ",

Click "directory" on the right of "JRE home" and select the folder C: \ Program Files \ Java \ jdk1.6.0 _ 06 \ JRE. All the way to "OK" and return to the "installed jres" interface,
Check "jdk1.6.0 _ 06. Select "execution environments" in the directory tree and click "J2SE-1.6" on the left side of the interface ",
Click "jdk1.6.0 _ 06" on the right ". Restart eclipse. Everything is OK.
The problem is that the system has installed two JRE, And the JRE in JDK should be used.
Or edit the existing JRE, and click Add extends jars to add the JDK \ Lib \ tools. jar file.

However, you should also note that the created Maven project reference is still the original JRE. You need to modify it. After completing the above steps, right-click the project name-> build path-> Configure build path-> select the referenced JRE under the library tab, remove it, and click Add library on the right, select JRE system library and follow the default operation to execute next-finish, so that the original project has been changed.

Original article address:

Http://blog.csdn.net/shanliangliuxing/article/details/6982767

When installing the maven plug-in on eclipse, the following error solution reference address is encountered:

http://v-vampires.iteye.com/blog/988290

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.