Jenkins JDK17 Docker still using JDK9?



  • I installed docker for Jenkins JDK17

    docker pull jenkins/jenkins:jdk17
    

    Reason being I run a single node (I know isn't the best practice, but for trying out) and my target application is also a Java build.

    Now, the issue is when I checked the version in a build, it is still Java 9 Not 17! Results in build failures.

    + java -version
    java version "9.0.4"
    Java(TM) SE Runtime Environment (build 9.0.4+11)
    Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
    

    How can I get JDK 17 so that I can build my application using Jenkins Docker?



  • Actually looks like I haven't done a great build-setup here. The way to correctly do this is not trying to change the default JDK (even though I still think there's an issue in the Docker..). What really required is a "Tool" section under JDK section for the builds to work with the custom JDK. So the notion from Jenkins, the Agent JDK is what I need, and not to worry about the Controller JDK really.

    A great video that I came across that helped:

    https://www.youtube.com/watch?v=qx3XK82BZPk



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2