Article View: borland.public.jbuilder.java.language
Article #17007Re: Environment Variable
From: Chris Hill
Date: Sat, 26 Dec 1998 00:00
Date: Sat, 26 Dec 1998 00:00
31 lines
1445 bytes
1445 bytes
On Sat, 26 Dec 1998 16:24:07 +0900, Arumugam <arumugam@kbo.mss.co.jp> wrote: >Hi, > Can anyone tell me how to read and write the environment variable in >JAVA. > Is there any class available.? > Can I know the function name.? > > Thanks in advance > > with Regards > > Arumugam You could never write environment variables in Java. You can't even read environment variables anymore. System.getenv is not only depricated, it is also no longer implemented (it just throws an exception). You will either need to write some platform specific code and call it using JNI, or forget true environment variables and use the system properties as recommended by Sun (the System.getProperty family). I don't think the system properties are replacement for the environment variables unless the environment variables are added to the system property table by the JVM (which they aren't), but that is Sun's recommendation in the docs. Chris Hill hillca@cs.purdue.edu
Technical Details
Message-ID:
<368505a0.597051314@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36848F16.7C03E5BA@kbo.mss.co.jp>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,7fa13fd8250143d6 X-Google-Attributes: gidf74b3,public From: hillca@cs.purdue.edu (Chris Hill) Subject: Re: Environment Variable Date: 1998/12/26 Message-ID: <368505a0.597051314@forums.borland.com> X-Deja-AN: 425962512 References: <36848F16.7C03E5BA@kbo.mss.co.jp> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.language