gcj: accessing environment variables
Nic Ferrier
nferrier@tapsellferrier.co.uk
Wed Apr 30 18:34:00 GMT 2003
erik poupaert <erik.poupaert@chello.be> writes:
> I was going to read an environment variable MYPERSONALENVVAR and I tried
> to access its value with System.getenv(), until I discovered that
> System.getenv() throws a "deprecated" exception, and that I should use
> System.getProperty() instead.
>> Then I tried to read System.getProperty("MYPERSONALENVVAR"), just to get
> a null in return.
>> Does anybody know how I can get hold of environment variables in gcj?
The Java platform no longer allows it.
I don't think we should conform to spec though. Personally I'd be
happier if getenv didn't throw a deprecated exception.
The alternative IMHO is to make System.getProperty look in the
environment table as a last resort before returning null.
Nic
More information about the Java
mailing list