Article View: borland.public.jbuilder.java.language
Article #234Re: System.getenv() problem
From: Lori M Olson [TeamB]
Date: Thu, 02 Mar 2006 14:53
Date: Thu, 02 Mar 2006 14:53
47 lines
2524 bytes
2524 bytes
Oliver wrote:
> Hi,
>
> i have a little problem in retrieving system environment variables.
> Windows 2000 SP4. I use JDK 1.5 and - under normal circumstances - my
> Java app retrieves the System.getenv() map correctly. But: if i start
> my Java app from another Delphi app (i use ShellExecute there), i
> dont get the map.
>
> Interestingly this behavior is also system dependent: on my desktop
> it doesnt matter how i start my Java app, on my laptop i get the
> environment only when i start my Java app manually (not when i start
> it via the Delphi app).
>
> I guess this is connected to parent/child processes but im unsure
> what is the best way to solve this...
>
> regards
>
> Oliver
>
Because this works manually, but not from the Delphi ShellExecute, I'm
going to point directly at Delphi as source of the issue. You'll need
to find out more about ShellExecute, and how to ensure that the
environment is passed to child processes.
Is there documentation for ShellExecute? What does it say?
--
Regards,
Lori Olson [TeamB]
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
http://www.google.ca/advanced_group_search
Other Newsgroup Searches:
http://www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
http://www.visi.com/~gyles19/fom-serve/cache/1.html
Technical Details
Message-ID:
<44070700$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!feeder.xsnews.nl!216.196.110.148.MISMATCH!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder1.cambrium.nl!feed.tweaknews.nl!newsfeeder.wxs.nl!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<44070483$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,a9217b09f375ec94 X-Google-Attributes: gidf74b3,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 02 Mar 2006 07:53:52 -0700 From: "Lori M Olson [TeamB]" <javadragon@techie.com> User-Agent: Thunderbird 1.5 (Macintosh/20051201) MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language Subject: Re: System.getenv() problem References: <44070483$1@newsgroups.borland.com> In-Reply-To: <44070483$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 142.179.182.172 Message-ID: <44070700$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1141311232 142.179.182.172 (2 Mar 2006 06:53:52 -0700) Lines: 47 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!feeder.xsnews.nl!216.196.110.148.MISMATCH!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder1.cambrium.nl!feed.tweaknews.nl!newsfeeder.wxs.nl!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail