title: How to configure toolchains plugin in m2e / Installed maven in Eclipse
body: <p>Currently i am using <strong>maven(Apache Maven 3.3.9)</strong> <strong>&amp; Java(Java version: 1.8.0_91)</strong> installed in  my windows machine. I have a java application which was developed using <strong>Java Version 1.6.0_31</strong>. </p>
  
  <p>Since <strong>Apache maven(3.3.9)</strong> is not directly compatible with the previous version of Java(Prior to 1.8) I have included <strong><a href="https://maven.apache.org/guides/mini/guide-using-toolchains.html" rel="noreferrer">toolchains plugin</a></strong> to compile and run the project with <strong>Java 1.6</strong>.  I can do a successful build using command prompt.</p>
  
  <p>But when I try to build the same project using eclipse with <strong>eclipse m2e plugin</strong> or by adding the <strong>external maven(3.3.9)</strong> using <em>eclipse->Windows->Preferences->Maven->Installations</em>, I am getting the below error.</p>
  
  <pre><code>[WARNING] 
  [WARNING] Some problems were encountered while building the effective settings
  [WARNING] Expected root element 'settings' but found 'toolchains' (position: START_TAG seen ...OOLCHAINS/1.1.0 http://maven.apache.org/xsd/toolchains-1.1.0.xsd"&gt;... @45:114)  @ U:\POC\Repo\.m2\toolchains.xml, line 45, column 114
  [WARNING] 
  [INFO] Scanning for projects...
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building Replenishment Maven Webapp 0.0.1-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Replenishment ---
  [INFO] Deleting C:\Users\xagh9\workspace\Replenishment\target
  [INFO] 
  [INFO] --- maven-toolchains-plugin:1.1:toolchain (default) @ Replenishment ---
  [INFO] Required toolchain: jdk [ vendor='sun' version='1.6' ]
  [ERROR] No toolchain found for type jdk
  [ERROR] Cannot find matching toolchain definitions for the following toolchain types:
  jdk [ vendor='sun' version='1.6' ]
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 7.105 s
  [INFO] Finished at: 2017-01-04T12:02:08+11:00
  [INFO] Final Memory: 8M/116M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain (default) on project Replenishment: Cannot find matching toolchain definitions for the following toolchain types:
  [ERROR] jdk [ vendor='sun' version='1.6' ]
  [ERROR] Please make sure you define the required toolchains in your ~/.m2/toolchains.xml file.
  [ERROR] -&gt; [Help 1]
  [ERROR] 
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
  </code></pre>
  
  <p><strong>Note:</strong>  With Java_1.8 I can build the project successfully without toolchains plugin. But with toolchains plugin configured I am facing this issues. Can anyone help me to resolve this.</p>
  
  <p><strong><em>The required toolchains.xml is present in both maven config folder as well as in the .m2 folder of the repository</em></strong></p>
  
  <p>UPDATE:
  Maven compiler plugin configuration:
  <a href="https://i.stack.imgur.com/v5q91.png" rel="noreferrer"><img src="https://i.stack.imgur.com/v5q91.png" alt="Plugin"></a></p>