[kaffe] System.getenv() ?

S. Meslin-Weber twiun@adorphuye.com
Mon Apr 5 06:10:02 2004


On Mon, Apr 05, 2004 at 02:10:19PM +0200, Arnaud Vandyck wrote:
> "S. Meslin-Weber" <twiun@adorphuye.com> writes:
> 
> > Hi pancake,
> >
> > On Mon, Apr 05, 2004 at 01:35:51AM +0200, pancake wrote:
> >> I'm glad to see that System.getenv() is not supported on GNU
> >> ClassPath and works perfectly under sun JDK...what's the reason?
> >> 
> >
> > To my knowledge, getenv has been deprecated from 1.1 to 1.4 and has only
> > been reintroduced with 1.5. As Classpath (and other parties) has to play
> > catch-up to Sun it's understandable it's not back in yet. Also, note
> > that 1.5 is not final and anything is still subject to change. I would
> > find it inadvisable to change our APIs until we can be sure that Sun
> > won't change theirs at the last minute.
> 
> Isn't System.getProperty("the.property") the same thing?

No, not at all. Java system properties are not sourced from the
environment variables of the OS. It's possible to push the contents of a
particular env var through to a system property though:

java -Dmy.system.property="$MY_ENV_VAR"

Thanks,

Stephane