java - Environment variables passed by Runtime.exec(String) -
are environment variables of parent process(e.g. shell) available in environment in child process invoked using runtime.exec(command) run? had @ api documentation it's not specified there.
my use case this
mainscript.sh invokes java mainclass
mainclass invokes runtime.exec("hi.sh")
now, variable my_env set , exported in mainscript.sh available hi.sh?
ps: i'm aware of 2nd api takes explicit string[] envp.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4064912 has vague info.
yes, why not?
from runtime documentation:
every java application has single instance of class runtime allows application interface environment in application running
Comments
Post a Comment