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