Need to set an environment variable (user-defined) on Solaris
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sairam_Krishna
Posted On:   Wednesday, August 29, 2001 02:32 PM

Hi,

I'm trying to set an environment variable from my java program.



Something equivalent of doing a 'setenv MY_VARIABLE variable_value' at the shell prompt.
Doing a System.setProperty(MY_VARIABLE variable_value) does not help becuase this is only being reflected when I do a System.getProperties but is not being recognized by the OS when I type 'env' at the shell.



Thanks.

Re: Need to set an environment variable (user-defined) on Solaris

Posted By:   Stevens_Gestin  
Posted On:   Wednesday, September 5, 2001 04:38 AM

May be try to execute an external process (i.e. an shell script) which will set the env parameter for you with the value you pass to it.



It may work for your job. Not sur at all as I don't now if the environment parameter will only be set for the process or all processes... Someone can confirm ?



thanks

Re: Need to set an environment variable (user-defined) on Solaris

Posted By:   Simon_Ablett  
Posted On:   Thursday, August 30, 2001 02:31 AM

Siriam,
Java does not provide access to the Operating System's environment variables - because they are system specific and in fact some OSes may not have a concept of an environment variable.
Regards.
About | Sitemap | Contact