Although it is best _not_ to use the system environment if you can help it, in
cases where it is necessary (and I tend to think that this may one of those
circumstances where it might be legitimate), you can always invoke the OS 'set'
command and stuff the output into Properties object.  This is not the whole
solution, because under unix you can have results that look like this (notice
the function entry in the last 4 lines):

     packagename=test
     s=INV21/Inv21
     lj=()
     {
         \ls -ltr $@ | grep -v _t | grep 'java$'
     }

But this is one fairly portable way to get at the environment and its not the
worst kludge I have ever see.

cc

Eugene Zhuravlev wrote:

> Hi Ted,
>
> Since IDEA is a java program it cannot read system environment (there's
> simply no API for that).
> One option is not using environment variables and pass parameters through
> the command line. If your program does require usages of environment
> variables you can set up an external too that calls a bat-file which in turn
> will start "myTest" with the proper command line.
>
> Best regards,
> Eugene Zhuravlev
> IntelliJ Software, http://www.intellij.com/
> "Develop with pleasure!"
>
> ----- Original Message -----
> From: "Ted Hill" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: 30 November, 2001 10:16 PM
> Subject: [Eap-list] VM parameters
>
> > Build #513
> > JDK 1.3.1
> > NT 4.0
> >
> > Note that on the DOS box command line I can do this:
> >
> >
> > >java -D"myEnvironmentVariable=%SOME_ENVIRONMENT_VARIABLE%"  myTest
> >
> > and in myTest, I can do the following:
> >
> > String envVariable   = System.getProperty("myEnvironmentVariable");
> >
> > now envVariable will be equal to the NT value of SOME_ENVIRONMENT_VARIABLE
> >
> > However, in IntelliJ, if I set my VM Parameters to
> >
> > -D"myEnvironmentVariable=%SOME_ENVIRONMENT_VARIABLE%"
> >
> > and start myTest from inside IntelliJ,
> >
> > envVariable will simply be the string:  %SOME_ENVIRONMENT_VARIABLE%
> >
> > rather than the value of the environment variable itself.
> >
> > Ted Hill
> >
> >
> > _______________________________________________
> > Eap-list mailing list
> > [EMAIL PROTECTED]
> > http://www.intellij.com/mailman/listinfo/eap-list
>
> _______________________________________________
> Eap-list mailing list
> [EMAIL PROTECTED]
> http://www.intellij.com/mailman/listinfo/eap-list


_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to