Maven in Eclipse complains that “Unable to locate the Javac Compiler” whenever POM changed

后端 未结 12 773
后悔当初
后悔当初 2020-12-05 07:25

I got error message every time I changed my pom.xml in eclipse.

Build errors for myapp; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to ex         


        
相关标签:
12条回答
  • 2020-12-05 07:53

    This is the step I did to solve that problem (Eclipse 3.7 Indigo):

    Window -> Preferences -> Java -> installed JREs -> I have a JRE from the JDK location, my location looks like C:\Program Files\Java\jdk1.6.0_26

    Window -> Preferences -> Java -> installed JREs -> Execution Environments -> Select JavaSE-1.6 and select a compatible JDK which should be the one set in the previous step.

    0 讨论(0)
  • 2020-12-05 07:53

    Window -> Preferences -> Java -> installed JREs, add jdk6 to point to your jdk(C:\Program Files\Java\jdk1.6.0_25), delete default jre6. it works.

    0 讨论(0)
  • 2020-12-05 07:54

    Window -> Preferences -> Java -> installed JREs -> Execution Enviroments -> click the checkbox on the right side

    0 讨论(0)
  • 2020-12-05 07:54

    This worked for me too :

    1. Go to Window -> Preferences -> Java -> installed JREs
    2. Select the JRE you are using (Should be the one inside jdk. Ex: C:\Program Files\Java\jdk1.6.0_25\jre)
    3. Press Edit -> Add External JARs...
    4. Browse to Java\jdk1.6.0_25\lib and select tools.jar and Press Enter
    5. Press Finish and OK
    0 讨论(0)
  • 2020-12-05 07:54

    It looks like your JAVA_HOME is not set properly. Can you echo JAVA_HOME from your terminal & see where it is pointing to? From the above error log it looks like its pointing to program files folder.

    0 讨论(0)
  • 2020-12-05 07:55

    If you are encountering this problem when trying to run maven from eclipse, then you may want to refer to this discussion, which also outlines the solution.

    0 讨论(0)
提交回复
热议问题