How to Fix Jenkins Console Log Encoding Issue on Windows

Chairat Onyaem
Oct 2, 2017 · 2 min read

If you get alien characters in console log of your job like this:

Then you have a problem with Java file encoding issue. Refer to this thread on StackOverflow, you need to add java argument -Dfile.encoding=UTF8 when running Jenkins with java command.

But in Windows, this is not straightforward when you install Jenkins as a Windows services.

Windows Service Wrapper

To run Java application as a Windows service, you cannot run it directly using java command but you need a wrapper. Jenkins uses WinSW as a services wrapper to run java and jenkins.war.

Per its documentation, you can specify Java argument in the XML config file i.e. jenkins.xml, like this:

-Dfile.encoding=UTF8
Editing Jenkins’ WinSW XML Config File

Now, you can see nicely character in console log. Cheers!


Chairat.me

Personal blog of a developer who passionate in new practices and technologies

Chairat Onyaem

Written by

Developer — chairat.me

Chairat.me

Personal blog of a developer who passionate in new practices and technologies