This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcj: accessing environment variables


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]