# How to upgrade java11 to 17 in jenkins container?

**URL:** <https://community.jenkins.io/t/how-to-upgrade-java11-to-17-in-jenkins-container/32302>\
**Category:** Ask a question\
**Tags:** question, java\
**Created:** [June 4, 2025, 3:18am UTC](https://community.jenkins.io/t/how-to-upgrade-java11-to-17-in-jenkins-container/32302 "2025-06-04T03:18:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cc901109](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/cc901109/32/13975_2.png) [@cc901109](https://community.jenkins.io/u/cc901109)\
**Post date:** [June 4, 2025, 3:18am UTC](https://community.jenkins.io/t/how-to-upgrade-java11-to-17-in-jenkins-container/32302/1 "2025-06-04T03:18:22Z")

</div>

Hello everyone,  
I have a running jenkins container, it’s AIphine 3.16.2 and jenkins v2.461 with java openjdk11.  
But JAVA11 EOL, I need to upgrade it to JAVA 17.

I don’t want to recreate a container, so can anybody teach me how to update java version when i in conainer?

Thanks a lot

---

<div class="post-metadata">

**Author:** ![uhafner](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/uhafner/32/68_2.png) [@uhafner](https://community.jenkins.io/u/uhafner)\
**Post date:** [June 4, 2025, 8:56am UTC](https://community.jenkins.io/t/how-to-upgrade-java11-to-17-in-jenkins-container/32302/2 "2025-06-04T08:56:11Z")

</div>

In fact, the concept of applications in containers works the other way around: you simply update the container as the application versions change…

When you really want to stay with the old version of Alpine and Java then you should ask in the corresponding docker forums (but they might use the same arguments) . And when you are going to upgrade: please migrate to Java 21 as Java 17 EOL ist coming soon…

---

<div class="post-metadata">

**Author:** ![cc901109](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/cc901109/32/13975_2.png) [@cc901109](https://community.jenkins.io/u/cc901109)\
**Post date:** [June 4, 2025, 9:36am UTC](https://community.jenkins.io/t/how-to-upgrade-java11-to-17-in-jenkins-container/32302/3 "2025-06-04T09:36:11Z")

</div>

Hi, I solved it.  
I download openjdk21 and copy it into container,then restart jenkins service.  
Finally it success…

But there’s another question my jenkins container’s OS EOL too…

---

<div class="post-metadata">

**Author:** ![cc901109](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/cc901109/32/13975_2.png) [@cc901109](https://community.jenkins.io/u/cc901109)\
**Post date:** [June 5, 2025, 9:09am UTC](https://community.jenkins.io/t/how-to-upgrade-java11-to-17-in-jenkins-container/32302/4 "2025-06-05T09:09:40Z")

</div>

Hello,  
I upgrade jenkins,java and plugins successfule, am i need to upgrade agent’s version.  
Or it will be error?

---

<div class="post-metadata">

**Author:** ![mawinter69](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mawinter69/32/1625_2.png) [@mawinter69](https://community.jenkins.io/u/mawinter69)\
**Post date:** [June 5, 2025, 9:58am UTC](https://community.jenkins.io/t/how-to-upgrade-java11-to-17-in-jenkins-container/32302/5 "2025-06-05T09:58:14Z")

</div>

It’s always a good idea to keep the agents version in sync with what the controller bring. You get that automatically for ssh agents. For inbound agents you could run a curl upfront as shown on the agents page in Jenkins when it is not connected  
E.g. for Linux

```auto
curl -sO http://localhost:9090/jnlpJars/agent.jar;java -jar agent.jar -url http://localhost:9090/ -secret 9374cf4d755e163c374e4ca021ab05bc16b54a153ec631f9df0798f8b9c94ac5 -name inbound -webSocket -workDir "/data/test"

```

or for windows

```auto
curl.exe -sO http://localhost:9090/jnlpJars/agent.jar & java -jar agent.jar -url http://localhost:9090/ -secret 9374cf4d755e163c374e4ca021ab05bc16b54a153ec631f9df0798f8b9c94ac5 -name inbound -webSocket -workDir "/data/test"

```
