This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gcj: accessing environment variables
- From: Nic Ferrier <nferrier at tapsellferrier dot co dot uk>
- To: erik poupaert <erik dot poupaert at chello dot be>
- Cc: java at gcc dot gnu dot org
- Date: 30 Apr 2003 19:11:07 +0100
- Subject: Re: gcj: accessing environment variables
- References: <1051723461.2598.23.camel@presariolinux>
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