🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #18237

Re: Help on get env values from Java

#18237
From: Peter Jacobs
Date: Mon, 20 Jul 1998 00:00
27 lines
1259 bytes
AFAIK there's now no mechanism to read the environment directly. 
Instead you can use the "-D" option when invoking the interpreter, thus:

	Java -DTMP=%TMP% <rest of command line>

If %TMP% = "C:\Temp" then the following:

	String tmpDir = System.getProperty("TMP");

will return just that.


ALTA Analytics wrote:
> 
> Dear Colleague,
>  I want to get the value of my envioronment variables from Java code. There
> is a method called System.getenv(String key) which is depricated and do not
> work. Does anybody know how to do it?
>  Thank you very much!
> Pan

-- 
Peter Jacobs
Principal Software Engineer
Computerised Document Control Ltd
Email : peterj@docctrl.com
WWW : http://www.docctrl.com
Technical Details
Message-ID: <35B3CA13.D93CF054@docctrl.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <01bdb41a$e4f12440$1ad812c7@jpan>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,85035a479ef0d3be
X-Google-Attributes: gidf74b3,public
From: Peter Jacobs <peterj@docctrl.com>
Subject: Re: Help on get env values from Java
Date: 1998/07/20
Message-ID: <35B3CA13.D93CF054@docctrl.com>
X-Deja-AN: 373316127
Content-Transfer-Encoding: 7bit
References: <01bdb41a$e4f12440$1ad812c7@jpan>
Content-Type: text/plain; charset=us-ascii
Organization: Computerised Document Control
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language