Maven build failed: “Unable to locate the Javac Compiler in: jre or jdk issue”

后端 未结 30 2040
长情又很酷
长情又很酷 2020-11-30 20:33

I have my JAVA_HOME set to:

C:\\Program Files (x86)\\Java\\jdk1.6.0_18

After I run maven ins

30条回答
  •  悲&欢浪女
    2020-11-30 21:16

    As mentioned by several others, the Eclipse WindowPreferences...JavaInstalled JREs should point to the JDK you installed, not to the JRE. Only then it can find the ../lib folder mentioned in the error message.

    Even with this, the problem may recur. My way out in Eclipse v4.2 (Juno) is to do a menu MavenUpdate project... after which the problem disappears.

    I suspect the reason is that some of the Eclipse generated files (.classpath, .project, .preferences) are in Subversion for the project in which I'm having these problems. Thus, an SVN update introduces the problem, and an configuration update from Maven in Eclipse resolves it again.

    Real solution: omit Eclipse generated .files from version control, and let the Maven Eclipse plugin handle project configuration. (Additional pointers/suggestions are welcome).

提交回复
热议问题