I have Java version 1.8.111 installed and the initial error message after running mvn3 install
was as below.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain (default) on project myfile: 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.
To resolved this, I've updated my toolchains.xml to version 1.8.111 but still getting the same error. I've also tried after running mvn3 clean
and successfully cleaned but still getting the same error.
Could anyone pinpoint where this version 1.6 is fetched from? I checked JAVA_HOME already, it's set to 1.8.
Can anyone explain how maven calls Java version?
Appreciate your help.
Below is my toolchains.xml
Your application is expected to be built with JDK 1.6
and to locate it Maven is looking for definition of [ vendor='sun' version='1.6' ]
within toolchains.xml
in your {home}/.m2/
directory (see eg this maven guide). You just need to point to it and all should be good.
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>1.6</version>
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>/Library/Java/JavaVirtualMachines/jdk1.6.X_XX.jdk/Contents/Home</jdkHome>
</configuration>
</toolchain>
</toolchains>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With