NOTE : for the Cloud (Remote Engine) replace the line :
System.out.format("%s=%s%n", envName, env.get(envName)); by context.output += ( envName + " = " + env.get(envName) + "\n"); and display the context.output in the task log using a tJoblog
Execute the task in the Cloud with "Execution log level" set to Info
Solution or Workaround
Modify the script launching the JobServer / Remote Engine start_rs.sh (JobServer/agent).
III - For Remote Engine launched as a service , you'll need to set the variables in the file <Remote Engine Folder>\etc\Talend Remote Engine-wrapper.conf