title: OpenShift & Jenkins: Slave went offline during the build when using JDK 8
body: <p>I have an application in OpenShift that is built using Jenkins. The application is built using Gradle (configured according to <a href="https://blog.openshift.com/run-gradle-builds-on-openshift/" rel="nofollow noreferrer">https://blog.openshift.com/run-gradle-builds-on-openshift/</a>) and needs to be built using JDK 8. I followed the advice from <a href="https://stackoverflow.com/questions/24513572/how-to-update-jdk-on-jenkins-server-cartridge-openshift">How to update JDK on Jenkins Server cartridge (OpenShift)?</a> and configured the JDK to be downloaded which works perfectly (I can see the JDK being downloaded in the log) however the build now never finishes, instead I get the following error:</p>
  
  <blockquote>
    <p>Slave went offline during the build
    ERROR: Connection was broken: java.io.IOException: Unexpected termination of the channel
        at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:50)
    Caused by: java.io.EOFException
        at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2332)
        at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2801)
        at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:801)
        at java.io.ObjectInputStream.(ObjectInputStream.java:299)
        at hudson.remoting.ObjectInputStreamEx.(ObjectInputStreamEx.java:40)
        at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34)
        at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)</p>
    
    <p>Build step 'Execute shell' marked build as failure
    ERROR: Publisher hudson.tasks.ArtifactArchiver aborted due to exception
    hudson.AbortException: no workspace for diy-build #9
        at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:72)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
        at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
        at hudson.model.Build$BuildExecution.post2(Build.java:183)
        at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
        at hudson.model.Run.execute(Run.java:1766)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:98)
        at hudson.model.Executor.run(Executor.java:374)
    Finished: FAILURE</p>
  </blockquote>
  
  <p>The build sometimes aborts at different stages, sometimes during the download of the dependencies, sometime sduring the compilation stage.</p>
  
  <p>If I remove the JDK 8 from the build, it works again, however my tests fail because they need Java 8.</p>