Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
163 views
in Technique[技术] by (71.8m points)

java - How set encodings in Jenkins to UTF-8

Cyrillic symbols in the Console output are not displayed correctly. Jenkins is running through Tomcat / 8.5.11 on Windows 7
The Jenkins property displays:
file.encoding Cp1251
sun.jnu.encoding Cp1251
sun.stderr.encoding cp866
sun.stdout.encoding cp866

How can I set the encoding on UTF-8 in Jenkins? Encoding in autotest code is UTF-8.
It is example problem in Cyrillic text
_Р?Р°Р?С?РёР?С?Р?_РёР?С?Р?С?Р?Р°С?РёРё

SOLVED: I created file setenv.bat in bin folder and set JAVA_OPTS="-Dfile.encoding=UTF-8"

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

According to this answer: JVM property -Dfile.encoding=UTF8 or UTF-8?

You have to add this JVM setting to your Jenkins starting script (JAVA_TOOLS_OPTIONS):

-Dfile.encoding=UTF8

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...