title: How to compile and build Java eclipse code through Jenkins pipeline?
body: <p>I have local copy of Git java code.I want a pipeline job script in Jenkins that can compile and build the code locally and show success or failure .</p>
  
  <p>I need a script which use only Java JDK not the maven (as the source code is developed using eclipse java project).</p>
  
  <p>The os i am using is windows.</p>
  
  <pre><code>pipeline {
      agent any
  
      stages {  
          stage ("build") {
              tools {
                 jdk "jdk-1.8.0_181"
              }
              steps {
                  sh 'java -version'
              }
          }          
     }}
  </code></pre>
  
  <p>I am getting below error</p>
  
  <p>org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
  WorkflowScript: 7: Tool type "jdk" does not have an install of "jdk-1.8.0_181" configured - did you mean "Oracle JDK 8"? @ line 7, column 24.
                        jdk 'jdk-1.8.0_181'
                            ^</p>
  
  <p>1 error</p>