Hi,
I am trying to run a Linux Shell Script using Spring-Batch SystemCommandTasklet, and the Linux Shell Script is working fine using SystemCommandTasklet.
My problem is, I want to setEnvironmentParams(String[]) method to set some environmentParams.
I want to set some set some environmentParams like
JAVA_HOME=/path/to/java/dir
CATLINA_HOME=/path/to/apache/tomcat/dir
When I tried to set those environment params and tries to access those environment params in the shell script, I am not able to access those environment params
like -
and in the shell script (display_envp_script.sh) -Code:String javahome = "JAVA_HOME=/path/to/java/dir"; String catlinahome = "CATLINA_HOME=/path/to/apache/tomcat/dir"; systemCommandTasklet.setEnvironmentParams(new String[]{javahome ,catlinahome }); systemCommandTasklet.setCommand("sh display_envp_script.sh")
no output i can in the terminal. Is the process I am doing wrong or the format of setting the environmentParams is wrong. if yes please correct me.Code:echo $JAVA_HOME echo $CATLINA_HOME
Thank you.


Reply With Quote