🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Put a value to system variables

#584
From: John McGrath [TeamB]
Date: Wed, 16 Mar 2005 01:52
23 lines
1784 bytes
On 3/15/2005 at 9:35:23 AM, tolis wrote:

> I' d like to ask , how can i put a value e.g. 'C:\Program Files\Microsoft
> Office\Office'
> into System Variable using Java.

What do you mean by "System Variable"?  If you are talking about defining
a variable externally and then accessing it from your Java code, you can
use a System Property.  With many Java launchers, you can define a system
property on the command line using an option line -Dproperty=value, and
you can retrieve the value in the Java code using System.getProperty().

With Java 1.5, you can also get the value of an environment variable with
System.getenv(), although support for this is system dependent.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <xn0dzsj2u6osrdy003@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4236f276@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,f391e0283c1eb2c9
X-Google-Attributes: gidf74b3,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "John McGrath  [TeamB]" <ng-b@JPMcGrath.net>
Subject: Re: Put a value to system variables
Newsgroups: borland.public.jbuilder.java.language
References: <4236f276@newsgroups.borland.com>
User-Agent: XanaNews/1.17.2.7
Message-ID: <xn0dzsj2u6osrdy003@newsgroups.borland.com>
X-Ref: newsgroups.borland.com ~XNS:00000297
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
NNTP-Posting-Host: 151.201.155.159
Date: 15 Mar 2005 17:52:42 -0800
X-Trace: newsgroups.borland.com 1110937962 151.201.155.159 (15 Mar 2005 17:52:42 -0800)
Lines: 23
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail