Persistent MalformedInputException After Java Update in Jenkins - Windows Setup

I’m facing a MalformedInputException: Input length = 4 error after updating both my Jenkins controller and agent nodes to Java 21 on Windows. This only happens in production; our staging environment, running an identical pipeline, works fine with Java 21.

Current Setup:

  • OS: Windows on both controller and agent nodes.
  • Java Version: Recently updated to Java 21.
  • Error: MalformedInputException: Input length = 4, triggered during a specific stage of the build.
  • Agent Version: Running the latest agent.jar.

Troubleshooting So Far:

Additional Questions:

  • Are there any known compatibility issues with Java 21 and Jenkins on Windows?
  • Could there be specific encoding configurations in agent.jar or Jenkins that need adjusting after the update?

Any advice would be greatly appreciated! Thank you in advance for your help.

I still can’t fix the error

any help please?

I’m not aware of any known compatibility issues with Java 21 and Jenkins on Windows.

I doubt it, since I would have expected many, many more reports of issues if there were a general purpose error. Over 27000 Jenkins controllers are running Java 21. I’m confident that a relevant portion of those controllers are running on Windows.

The adoption data for Java 21 is available in the JVMs tab of the Jenkins statistcs site. Currently it looks like this:

1 Like

Hi,

I am still out of luck with this and I really don’t know what to do. I tried to follow these guides


https://cloud.tencent.com/developer/ask/sof/107044554
https://stackoverflow.com/questions/17294382/how-to-add-more-than-one-parameter-to-java-tool-options
https://www.cnblogs.com/vipsoft/p/16857165.html
https://cloud.tencent.com/developer/article/2245164
https://www.linkedin.com/pulse/how-resolve-utf-8-encoding-issue-jenkins-ajuram-salim/
https://pacroy.com/how-to-fix-jenkins-console-log-encoding-issue-on-windows-a1f4b26e0db4
https://blog.csdn.net/u011397981/article/details/129786231

Any ideas? The only thing I can think of is create a new VM and try there and if it works just migrate.

I think that is a very good idea. Others are much better able to help if you can provide detailed steps that allow you to duplicate the failure.

Perhaps this can help, these are the system and environmental properties for both Agents

Working Agent:

https://ibb.co/WyHgjy1
https://ibb.co/bQr9PWb

Not working agent:

https://ibb.co/d2VpF1g
https://ibb.co/9nV37kn

Those are pictures of the properties. I won’t attempt to extract text from those pictures. Comparison is much more difficult when you provide pictures of text instead of just providing the text.