codecentric/jenkins-deployment-dashboard-plugin

Build failure - tools.jar not found

Closed this issue · 2 comments

Jenkins 1.581
Amazon Linux 2014.09
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T20:58:10+00:00)
Maven home: /usr/local/maven
Java version: 1.7.0_65, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.14.19-17.43.amzn1.x86_64", arch: "amd64", family: "unix"

'''
[INFO] Compiling 17 source files to /root/jenkins-deployment-dashboard-plugin/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 44.218 s
[INFO] Finished at: 2014-09-26T12:52:27+00:00
[INFO] Final Memory: 23M/405M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5:compile (default-compile) on project jenkins-deployment-dashboard: Fatal error compiling: tools.jar not found: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/../lib/tools.jar -> [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/MojoExecutionException
[root@i-4dfa6da0 jenkins-deployment-dashboard-plugin]# updatedb
[root@i-4dfa6da0 jenkins-deployment-dashboard-plugin]# locate tools.jar
/var/lib/jenkins/tools/hudson.model.JDK/Default/db/lib/derbytools.jar
/var/lib/jenkins/tools/hudson.model.JDK/Default/lib/tools.jar
/var/lib/jenkins/tools/hudson.model.JDK/Default/lib/visualvm/visualvm/modules/com-sun-tools-visualvm-tools.jar
'''

Hi @garlandkr. I noticed that maven is looking for the tools.jar in the jre directory. I assumed and this stackoverflow article confirms my assumption: The jre does not contain the tools.jar. Thus the project can't be built.

It also says in your build output:
"Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre"

So point Java_home to a jdk instead and you should be fine.

Hi @garlandkr,
I am closing this tickets since this seems to be a problem with your environment setup and not with this project in general. If you find any other problems let us know.
Greetings,
Marcel