1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Windows + Java 21環境で、Eclipse + WebSphere Libertyを使用するときのコンソールログの文字化け対策

Posted at

概要

Windows + Java 21の環境で、開発用途でEclipseとWebSphere Libertyを使用したとき、LibertyがEclipseのコンソールに出力したログが文字化けしてしまいました。

以下の記事で書かれているように、Liberty のサーバディレクトリにファイル jvm.optionsを作成し、-Dfile.encoding=UTF-8 を設定したものの改善されませんでした。

[参考記事]

Java 21では別の設定が必要であったため、その内容を以下記載します。

前提環境

  • OS:Windows 11
  • Java 21(IBM Semeru Runtime)
  • WebSphere Liberty 25.0.0.2
  • Eclipse 2024-06
  • IBM Liberty Developer Toolsプラグイン 24.1
  • EclipseのWorkspaceの Text file encoding として UTF-8 を設定済み(EclipseのメニューバーのWindow -> Preferences -> General -> Workspace -> Text file encoding)

設定内容

(IBM Liberty Developer Toolsプラグインなどで)Libertyのサーバを作成すると、WebSphere Libertyをインストールしたディレクトリに、usr/servers/<サーバ名> というディレクトリが作成されます。

このディレクトリに jvm.options というファイルを作成し、そのファイルに以下を記述します。

-Dstdout.encoding=UTF-8
-Dstderr.encoding=UTF-8

これにより、標準出力、標準エラーの文字エンコーディングがUTF-8となり、LibertyがEclipseコンソールに出力するログが文字化けしなくなります。

1
1
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?