Status: Open (View Workflow)
Jenkins 2.19.2 LTS, JDK 1.8.0u111
Jenkins 2.19.2 is running in JDK 1.8.0_111
A Maven project is configured to run in JDK 1.6. When the job is run an error message is displayed,
ERROR: Invalid project setup: hudson/maven/AbstractMavenProcessFactory$ConfigureOriginalJDK : Unsupported major.minor version 51.0
JENKINS-18403 JENKINS-28294 JDK 'JDK 1.6' not supported to run Maven projects.
ERROR: Maven projects have to be launched with a Java version greater or equal to the minimum version required by the master.
ERROR: Use the Maven JDK Toolchains (plugin) to build your maven project with an older JDK.
ERROR: Retrying with slave Java and setting compile/test properties to point to /opt/ci/java/x64/jdk1.6.
The last line of the error message leads the user to believe that the job is being run in a slave using JDK 1.6. It is not obvious from this error message (at least not to me) that the job is being run in the default JDK (1.8 in our case) and that runtime library (rt.jar) used to validate API calls in the application code will be from the default (1.8) JDK. It would be a little more clear if the last line of the error message read"
ERROR: Retrying the build using the default JDK (/opt/ci/java/jdk1.8) with the following options:
Due to the possible adverse effects of building JDK 1.6 apps in a JDK 1.8 compiler, it would also be nice to have an option to configure the maven project type to fail the build immediately when an incomparable JDK is configured in the job. This would allow a site to cause all builds that are misconfigured to fail immediately until the pom is updated to use toolchains, and the jenkins job is configured to use the default JDK.