Skip to content

Commit

Permalink
Add "-Dfile.encoding=UTF-8" to java arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
holysugar committed Jan 8, 2014
1 parent ece633c commit f1d2c04
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions templates/default/default.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ JAVA=/usr/bin/java
# arguments to pass to java
#JAVA_ARGS="-Xmx256m"
#JAVA_ARGS="-Djava.net.preferIPv4Stack=true" # make jenkins listen on IPv4 address
JAVA_ARGS="-Dfile.encoding=UTF-8"

PIDFILE=/var/run/jenkins/jenkins.pid

Expand Down
2 changes: 1 addition & 1 deletion templates/default/jenkins-slave.xml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ THE SOFTWARE.
The following value assumes that you have java in your PATH.
-->
<executable>java</executable>
<arguments>-Xrs -jar "<%= @jenkins_home %>\slave.jar" -jnlpUrl <%= @jnlp_url %> <%= !@jnlp_secret || @jnlp_secret.empty? ? '' : "-secret #{@jnlp_secret}" %></arguments>
<arguments>-Dfile.encoding=UTF-8 -Xrs -jar "<%= @jenkins_home %>\slave.jar" -jnlpUrl <%= @jnlp_url %> <%= !@jnlp_secret || @jnlp_secret.empty? ? '' : "-secret #{@jnlp_secret}" %></arguments>
<!--
interactive flag causes the empty black Java window to be displayed.
I'm still debugging this.
Expand Down
4 changes: 3 additions & 1 deletion templates/default/sv-jenkins-run.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ touch jenkins.start
exec chpst -u <%= node['jenkins']['server']['user'] %> -U <%= node['jenkins']['server']['user'] %> \
env HOME=<%= node['jenkins']['server']['home'] %> \
JENKINS_HOME=<%= node['jenkins']['server']['home'] %> \
java <%= node['jenkins']['server']['jvm_options'] %> -jar jenkins.war \
java <%= node['jenkins']['server']['jvm_options'] %> \
-Dfile.encoding=UTF-8 \
-jar jenkins.war \
-Xloggc:<%= node['jenkins']['server']['log_dir'] %>/gclog.log \
--httpPort=<%= node['jenkins']['server']['port'] %>
4 changes: 3 additions & 1 deletion templates/default/sv-jenkins-slave-run.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
exec 2>&1
cd <%= node['jenkins']['node']['home'] %>
exec chpst -u <%= node['jenkins']['node']['user'] %> \
java -jar <%= node['jenkins']['node']['home'] %>/slave.jar \
java \
-Dfile.encoding=UTF-8 \
-jar <%= node['jenkins']['node']['home'] %>/slave.jar \
-jnlpUrl <%= node['jenkins']['server']['url'] %>/computer/<%= node['jenkins']['node']['name'] %>/slave-agent.jnlp \
<%= !@options[:secret] || @options[:secret].empty? ? '' : "-secret #{@options[:secret]}" %> \
<%= node['jenkins']['node']['jvm_options'] %>
2 changes: 1 addition & 1 deletion templates/default/sysconfig.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ JENKINS_USER="<%= @user %>"
#
# Options to pass to java when running Jenkins.
#
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"
JENKINS_JAVA_OPTIONS="-Dfile.encoding=UTF-8 -Djava.awt.headless=true"

## Type: integer(0:65535)
## Default: 8080
Expand Down

0 comments on commit f1d2c04

Please sign in to comment.