Jenkins-Maven ERROR Failed to execute goal org apache maven plugins maven-compiler-plugin 3 1 compile default-compile on project myProject Fatal error compiling invalid target release 1 8

0 votes

Getting the following error on executing a Jenkins maven job. T

I ran Maven in debug mode:

...
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 14:51:28+0100)
Maven home: /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven305
Java version: 1.7.0_71, vendor: Oracle Corporation
Java home: /var/lib/jenkins/tools/hudson.model.JDK/JDK_7u71/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.8.0-44-generic", arch: "amd64", family: "unix"
...

The Jenkins server runs with Java 1.8

...
$ java -version
java version "1.8.0_74"
Java(TM) SE Runtime Environment (build 1.8.0_74-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)
...
$ javac -version
javac 1.8.0_74
Nov 4, 2019 in Jenkins by anonymous
• 19,610 points
8,807 views

1 answer to this question.

0 votes
This indicates that Maven uses Java 1.8 but it is supposed to use Java 1.7.

A proper solution is to add needed JDK to Jenkins global configuration and then to specifically choose needed JDK version/installation under the project build configuration.

Hope this helps!
answered Nov 4, 2019 by Sirajul
• 59,230 points

Related Questions In Jenkins

0 votes
1 answer

Error while trying to execute a maven project

Follow these steps: In global tool configuration: For Maven: ...READ MORE

answered Jan 3, 2019 in Jenkins by Vishnu
7,962 views
0 votes
2 answers

Error Jenkins: Failed to connect to repository

Jenkins runs as another user, not as ...READ MORE

answered Aug 7, 2019 in Jenkins by Sirajul
• 59,230 points
10,126 views
0 votes
5 answers

How to resolve this error “Jenkins Host key verification failed”?

HI Mam, Please check the following solution:: 1. Switch ...READ MORE

answered May 3, 2019 in Jenkins by anonymous
59,811 views
0 votes
1 answer

I’m facing a login error when I try to run Jenkins on Docker. How do I solve this?

You have to open the /var/log/jenkins/jenkins.log file to ...READ MORE

answered Jul 24, 2018 in Jenkins by Sophie may
• 10,610 points
3,272 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,439 views
+2 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP