Article View: borland.public.jbuilder.java.language
Article #14457Re: environment variables from within Java
From: Paul Furbacher [TeamB]
Date: Tue, 31 Aug 1999 00:00
Date: Tue, 31 Aug 1999 00:00
27 lines
1591 bytes
1591 bytes
Kevin D wrote: > Is it possible to access the environment variables from within Java? > Win NT, Win 95 or Unix It depends. See the JavaDocs for the System class. There are some which are obtainable via System.getProperty(...). However, those which you have created are not available. > If not, is the -D runtime parameter the work-around? Yes, you could do this. In fact, someone just wrote about doing this last week. The problem was that it works from the command line, but not from within the IDE (an inconsistency which is puzzling). So, if you had an environment setting called "JavaHome", you could write the command line: > set JavaHome=c:\jdk1.1.8 > java -DjavaHome=%JavaHome% ... but if you set the -D parameter in the Run | Parameters... dialog it would yield "%JavaHome%" and not "c:\jdk1.1.8". Quite unfortunate. You may choose to file a bug report on this novel feature of the IDE (note that I didn't call it a bug). Paul Furbacher (TeamB)
Technical Details
Message-ID:
<37CC4EC7.408B2B2A@bilbo.bio.purdue.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7qhc70$aho9@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,1698c67948d2aa23 X-Google-Attributes: gidf74b3,public From: "Paul Furbacher [TeamB]" <pf@bilbo.bio.purdue.edu> Subject: Re: environment variables from within Java Date: 1999/08/31 Message-ID: <37CC4EC7.408B2B2A@bilbo.bio.purdue.edu> X-Deja-AN: 519476431 Content-Transfer-Encoding: 7bit References: <7qhc70$aho9@forums.borland.com> Content-Type: text/plain; charset=us-ascii Organization: Reverse Alchemy, Inc. Mime-Version: 1.0 Reply-To: pf@bilbo.bio.purdue.edu Newsgroups: borland.public.jbuilder.java.language