setting enviroment variables within java
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   yashar_baradaran
Posted On:   Sunday, September 22, 2002 10:02 AM

Hi there ,

Does anyone know how we can set a win2000 enviroment variable from withing a java code ?

Thanks !

Re: setting enviroment variables within java

Posted By:   Anjan_Bacchu  
Posted On:   Sunday, September 22, 2002 06:38 PM

Hi,


Do you want to set this environment variable for

A) only the instance of the application that executes the code
B) all the applications in the OS
C) for all new applications that the application spawns ?



for (a), you can make JNI calls to the OS specific environment variables -- setEnvironment() WIN32 API call.

b) -- you are suggested to interact with the registry using JNI calls to the WIN Registry.


c) setenv() for the calling application so that it's copy of the environment changes.

Re: setting enviroment variables within java

Posted By:   AlessandroA_Garbagnati  
Posted On:   Sunday, September 22, 2002 10:16 AM

Hi,

I'm afraid you can't, since this seems to be a very not portable, os specific operation.
About | Sitemap | Contact