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.