An error occurred while running the maven install command (build failure)

Source: Internet
Author: User

A struts and spring integration project is created. The following error occurs when you run as-> Maven install:

**************************************** ***

[Error] failed to execute goal org. Apache. Maven. plugins: Maven-compiler-plugin: 2.0.2: Compile (default-compile) on Project SSH: Compilation failure
Unable to locate the javac compiler in:
D:/program files/myeclipse 6.0/JRE/../lib/tools. Jar
Please ensure you are using JDK 1.4 or above and
Not a JRE (the com. Sun. Tools. javac. Main class is required ).
In most cases you can change the location of your Java
Installation by setting the java_home environment variable.

**************************************** ****

What's even more strange is that it does not appear every time you run it. Occasionally, it can run successfully to generate a war package.

Most of the solutions to this problem on the Internet are:

1) set the java_home environment variable to C:/program files/Java/JDK
1.6.0/lib/tools. Jar

2) set in myeclipse:

<1> JAVA-> build path-> classpath variables->
Java_home
C:/program files/Java/JDK
1.6.0/lib/tools. Jar



<2> activate only (Or
Add) Module
Java-> installed jres->

JDK
1.6.0
C:/program files/Java/JDK
1.6.0

I tried to make changes, but they didn't have any effect. I hope the experts will give me some advice and I am very grateful to you!

Postscript:

Solution: WINDOW> preferences> JAVA> installed jres,
Click "add", select the default "Standard VM", click "next>", and click "JRE
Home "right of" directory "select folder D:/development/Java/jdk1.5.0 _ 16/JRE, all the way" OK ", back
Go to the "installed jres" Page and check the added "jdk1.5.0 _ 16. Then select "execution environments" in the directory tree ",
Click "J2SE-1.5" on the left of the interface, and then click "jdk1.5.0 _ 16" on the right ". Restart eclipse. Everything is OK. In addition, add two lines to the eclipse. ini file (you must add them before-vmargs and press Enter next to-VM):-VM
D:/development/Java/jdk1.5.0 _ 16/bin/javaw.exe do not know whether the solution to the problem has any impact. The problem is that the system has installed two JRE, And the JRE in JDK should be used.



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.