# Issue with Jenkins Java version please advise

**URL:** <https://community.jenkins.io/t/issue-with-jenkins-java-version-please-advise/22389>\
**Category:** Ask a question\
**Tags:** question\
**Created:** [October 25, 2024, 6:43am UTC](https://community.jenkins.io/t/issue-with-jenkins-java-version-please-advise/22389 "2024-10-25T06:43:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dilipbangalore](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/dilipbangalore/32/10847_2.png) [@dilipbangalore](https://community.jenkins.io/u/dilipbangalore)\
**Post date:** [October 25, 2024, 6:43am UTC](https://community.jenkins.io/t/issue-with-jenkins-java-version-please-advise/22389/1 "2024-10-25T06:43:20Z")

</div>

Hi Team,  
Good Morning, We have installed Jenkins latest version with Java 17. Tring to execute shell script on remote server via SSH connection with pipeline scripts.

Agent is not connecting the Remoteserver because of java used on remote server is Java8 and on Jenkins is installed with Java17, I am able to connect agent on local server where Jenkins installed ( java17)

[10/25/24 09:33:02] [SSH] Starting agent process: cd “/home/ofsaailx/agent” && java -jar remoting.jar -workDir /home/ofsaailx/agent -jar-cache /home/ofsaailx/agent/remoting/jarCache  
Error: A JNI error has occurred, please check your installation and try again  
Exception in thread “main” java.lang.UnsupportedClassVersionError: hudson/remoting/Launcher has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Option 2:

Installed Jenkins version supported for Java 8 on remote server jenkins-2.164.3 but after installation all the plugin’s are failed and asking to upgrade " You must update Jenkins from version 2.164.3 to version 2.387.3 or later to run this plugin"  
we have an issue here as per the documents of supported versions version 2.387.3 is not compatible with Java8 on remote server and we can’t upgrade version because remote server applications are only works on Java8 to execute these shell scripts commands.

_**2.419 (August 2023) and newer**_

Java 11, Java 17, or Java 21

_**2.357 (June 2022) and newer**_

Java 11 or Java 17

Request you please advise if you have any fix to overcome these issues. Thank you in advance.

---

<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:** [October 25, 2024, 10:16am UTC](https://community.jenkins.io/t/issue-with-jenkins-java-version-please-advise/22389/2 "2024-10-25T10:16:39Z")

</div>

When you use Jenkins 2.357 or newer then you must also use at least Java11 on your agents. Starting 2.463 you will need at least java 17 on the controller and your agents. If you build process still needs java8 then you need to install both java8 and java17 on your agent and configure it accordingly so the agent process uses java17 and the build process uses java8  
You should not use such old Jenkins versions like 2.164.3 as it has several security issues.

---

<div class="post-metadata">

**Author:** ![dilipbangalore](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/dilipbangalore/32/10847_2.png) [@dilipbangalore](https://community.jenkins.io/u/dilipbangalore)\
**Post date:** [October 26, 2024, 5:48am UTC](https://community.jenkins.io/t/issue-with-jenkins-java-version-please-advise/22389/3 "2024-10-26T05:48:28Z")

</div>

Hi Markus, Thank you for your reply. Sure i will try to install do you have any document how to configure these 2 different Java version on Jenkins agent server please share.

thanks  
Dilip

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [October 26, 2024, 2:04pm UTC](https://community.jenkins.io/t/issue-with-jenkins-java-version-please-advise/22389/4 "2024-10-26T14:04:49Z")

</div>

Refer to the answer and the tutorial video at:

> [@How to use two different versions of JDK](https://community.jenkins.io/t/how-to-use-two-different-versions-of-jdk/5856):
>
> We have a Jenkins controller and 3 agents (one of each application). I have multiple pipelines to deploy 3 different Java/J2EE legacy applications. They are not microservices applications. Jenkins & the applications currently uses Java 1.8. We are in the process of upgrading one of the application to Java version 11. How do I run Jenkins on two version of Java (8 & 11)? Can I have Java 1.8 in the controller and Java 11 in an agent?
