ERROR: Failed to parse POMs, Jenkins

This article contains an error that occurred while building a Maven project with the Jenkins server. My code is present in the Github repository and it’s a Java code. I have configured Jenkins to pull the code from the Git repository and build.

Jenkins project configuration details

Used Github as a source code management.


For JDK, I have installed it with the “yum” package manager ( Used Amazon Linux Operating sysytem) and enabled it in the Jenkins server as seen in the screenshot.

I have confirmed that all the required code files and pom.xml files are in place and triggered the build from the Jenkins dashboard but it is failed with the below error message.


The complete error message that got from the Jenkins console is given below.

Started by user admin

Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/First_Maven_project
No credentials specified
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url
 # timeout=10
Fetching upstream changes from
 > git --version # timeout=10
 > git fetch --tags --progress --
 +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 0d4d43993b3f7d527b69249f1dbb15f5b2830751 (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 0d4d43993b3f7d527b69249f1dbb15f5b2830751 # timeout=10
Commit message: "sample java code"
First time build. Skipping changelog.
Parsing POMs
Established TCP socket on 44039
[First_Maven_project] $ /usr/lib/jvm/java-1.8.0-openjdk- -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.13.jar:/opt/apache-maven/boot/plexus-classworlds-2.6.0.jar:/opt/apache-maven/conf/logging jenkins.maven3.agent.Maven35Main /opt/apache-maven /var/cache/jenkins/war/WEB-INF/lib/remoting-3.36.1.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.13.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.13.jar 44039
ERROR: Failed to parse POMs Cannot run program "/usr/lib/jvm/java-1.8.0-openjdk-" (in directory "/var/lib/jenkins/workspace/First_Maven_project"): error=2, No such file or directory
	at java.lang.ProcessBuilder.start(
	at hudson.Proc$LocalProc.<init>(
	at hudson.Proc$LocalProc.<init>(
	at hudson.Launcher$LocalLauncher.launch(
	at hudson.Launcher$ProcStarter.start(
	at hudson.maven.AbstractMavenProcessFactory.newProcess(
	at hudson.maven.ProcessCache.get(
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(
	at hudson.model.AbstractBuild$
	at hudson.model.Run.execute(
	at hudson.model.ResourceController.execute(
Caused by: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(
	at java.lang.ProcessImpl.start(
	at java.lang.ProcessBuilder.start(
	... 12 more
Finished: FAILURE

After digging the error I found that Jenkins is not able to use the Java SDK which we set in the Global Configuration, so as a workaround, I have changed the JDK installation as automatically.

Resolution for the error

Log in to the Jenkins server and click on “Manage Jenkins” from the left-side panel. Select Global Tool Configuration and click on the JDK installation button.

Give a name for the installation and tick the “Install Automatically”. Next, click on the “Add-installer” button and from the pop-up window, select “Install Oracle java SE from the website” option.


To installĀ  JDK from the oracle website you need an account with Oracle Technologies ( ). Configure the installer as follows and enter your credentials in the pop-up window.

Click apply and then save.

Try to build the code again, and this time you can see Jenkins server try to install the JDK from the Oracle web site.


It took a few minutes to complete the build process but completed successfully.

Leave a Reply

Your email address will not be published. Required fields are marked *