In some cases, it is necessary to set a JVM property, for example -Dfile.encoding=UTF-8, for all Jobs executed by a JobServer.
Resolution
For the JobServer Windows Service created by the installer:
- Edit the wrapper.conf file located in the folder \jobserver\TalendServices\conf, and add the line:
wrapper.app.env._JAVA_OPTIONS=-Dfile.encoding=UTF-8
Under the paragraph:
#*******************************************************************
# Application environment properties.
#*******************************************************************
# Adds an environment to the application
Example:
#*******************************************************************
# Application environment properties.
#*******************************************************************
# Adds an environment to the application
wrapper.app.env._JAVA_OPTIONS=-Dfile.encoding=UTF-8
- Restart the JobServer.
For a JobServer created with jsl_static64.exe:
- In the jsl_static64.ini file, add the following to the beginning of the file:
[defines]
_JAVA_OPTIONS=-Dfile.encoding=UTF-8
export=_JAVA_OPTIONS
- Restart the JobServer.
For a JobServer running on Linux:
Service:
Edit the /etc/systemd/system/talend-rjs*.service
Add:
Environment=_JAVA_OPTIONS=-Duser.timezone=Europe/Berlin
systemctl daemon-reload
stop / start jobserver Manual:
Option 1, for all users:
Edit /etc/profile (see: https://unix.stackexchange.com/a/151735/239457 )
Option 2, for specific user:
Edit ~/.bashrc Add: _JAVA_OPTIONS='-Duser.timezone=Europe/Vienna'
Add: export _JAVA_OPTIONS
Log OUT, start a new shell.
Start talend jobserver (nohup / screen / etc)
Verify:
After starting the job we will see:
Starting job hello_world at 11:12 29/01/2020.
Picked up _JAVA_OPTIONS: -Duser.timezone=Europe/Berlin
[statistics] connecting to socket on port 3664