Resolve 'sun.jnu.encoding' Change Issue in Jira Data Center
Platform Notice: Data Center Only - This article only applies to Atlassian apps on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
On Windows machines running Java 17, the sun.jnu.encoding can't be updated from Cp1252 to UTF-8.
Environment
Windows Server 2022
Java OpenJDK Temurin-17.0.7
Diagnosis
Configure below two properties in Jira startup options and restart Jira:
-Dfile.encoding=utf8
-Dsun.jnu.encoding=utf8In Jira Administration > System > System info
System Encoding is set as UTF-8
sun.jnu.encodingis set as Cp1252, which is unexpected
Cause
This issue is caused by a known OpenJDK Java defect, where this parameter is overridden by the value provided by the platform after JVM initialization; that means, it does not matter what you set on the JVM startup parameters.
The bug JDK-8275145 has been fixed in Java version 18 and backported to Java 17. However, the issue still persists on Java 17.
Solution
Workaround
To be able to use Java 17, please follow the steps:
In Windows, open the Control Panel and click on Region.
Select the Administrative tab
Click on Change System locale...
Check the option: Beta: Use Unicode UTF-8 for worldwide language support.
Restart Windows OS
The
sun.jnu.encodingin Jira switches to UTF-8 successfully.
Was this helpful?