I am able to run a Linux command via RunTime
class.
Is there a way of setting a Linux global enviroment from Java programatically?
I want to emulate the following Linux command statement over Java
root@machine:/tmp# export TEST=v2
I have used ProcessBuilder as following, but TEST variable does not changed.
ProcessBuilder pb = new ProcessBuilder("/bin/bash","-c","export TEST=v3" + "&& exec");
UPDATE: Actually my ultimate target is to use EMAIL_NAME enviroment as an email address, when both my application and machine are started and stopeed these actions will be sent to EMAIL_NAME. In that case I understand that it is not possible to set linux global enviroment over pure Java code. So I have a workaround solution is that EMAIL_NAME will be hold in a file and it will be updated or read by linux script or java code.