zowe / zowe/api-layer

First message wrong encoding with Java 21

Open
#4,419 5 comments 0 reactions 1 assignee View on GitHub

@hrishikesh-nalawade is already working on this.

Since Jan 27, 2026.

bug Priority: High size/S
Dominant language
Java
Stars
92
Forks
81
Avg merge
1d 9h
Merged PRs (30d)
46

Description

Using Zowe v3.3.1 (and v3.4.0rc3), the first messages of APIML are unreadable when using java 21, but are fine on java 17.

https://github.com/zowe/api-layer/blob/4c515e4c040da58d93b490c418e94ed9f2816772/common-service-core/src/main/java/org/zowe/apiml/product/version/BuildInfo.java#L43

This line is producing the problem message.
But it's using org.zowe.apiml.message.log.ApimlLogger which appears to work on every later message.
So... this is some weird startup-only behavior of ApimlLogger + J21?

When investigating, the UTF8 change in J21 caught attention
https://www.ibm.com/docs/en/semeru-runtime-ce-z/21.0.0?topic=guide-file-encoding-utf-8-as-default-charset

I noticed that apiml has been UTF8 for file.encoding longer than j21, but the link notes that there can be different behavior for console input/output. Is that accommodated in the logger?

Here's a screenshot of what the difference looks like. Later logs look identical.

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.