Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dolt131943/47b17152be4c77f67298a5d9e2e1950b to your computer and use it in GitHub Desktop.
Save dolt131943/47b17152be4c77f67298a5d9e2e1950b to your computer and use it in GitHub Desktop.
Jenkins Windows Slaver filename charset error ,中文文件名乱码

打开windows salver下的jenkins-slaver.xml,寻找下列段落:

...
<arguments>-Xrs  -jar "%BASE%\slave.jar" ...
...

添加jvm properties,指定字符集:

-Dfile.encoding=utf-8 -Dsun.jnu.encoding=utf-8

最后结果为:

...
<arguments>-Dfile.encoding=utf-8 -Dsun.jnu.encoding=utf-8 -Xrs  -jar "%BASE%\slave.jar" ...
...

Jenkins的console调用批处理时还是显示,但拷贝文件名倒是显示为中文了.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment