When running some commands, m2e (Maven eclipse) cannot compile (unable to locate the javac compiler in :)

Source: Internet
Author: User

Bug prompt

Unable to locate the javac compiler in:
C: \ Program Files \ Java \ jre1.6.0 _ 07 \ .. \ 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.

From abovePlease ensure you are using JDK 1.4 or above and
Not a JRE (the com. Sun. Tools. javac. Main class is required)

We can see that m2e requires JDK and JDK 1.4 or later for compilation.

Under the command lineEcho % java_home %

Check that my "java_home" isC: \ Program Files \ Java \ jdk1.6.0 _ 20

I realized that I was using m2e, so my runtime environment should be based on

Eclipse (eclipse also has its own runtime environment by default) is specified, so I only need to modify the runtime environment path specified by eclipse,

Therefore

1. Modify "window --> preferences-> JAVA-> installed jres" in Eclipse ":

Edit the selected JRE or add a new JRE and select it

The location shoshould be "C: \ Program Files \ Java \ jdk1.6.0 _ 20 \ JRE"

Please don't close the "Edit JRE" dialog, continue the second step.

2. Remove the default JRE system libraries and add all the jar inLibFolder, lib subdirectory in% Java_home %/JDK **/JRE/

Statement:

 

_ ^ _... I wish this bug report message will help u... and please comment this...

 

 

 

 

In the past few days when Maven was used, it has been found that you have installed your project. When such a bug occurs, you need to go to the repository and delete these existing versions.

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.