Re: System.getenv()



Benjamin Lerman <news+news-free@xxxxxxxxx> said:
My problem is: I need to exec an external process, and I need to add an
environment variable before doing so.

The problem is that if I use Runtime.exec(String), my environment is
the old one without my variable, and If I put an array with my new
environment variable, I lost my old environment.

If you're working with just Unix platforms, you could use /usr/bin/env
as a helper to start the external application, like:

/usr/bin/env NEWVARIABLE=value /path/to/extcomm arg1 arg2

--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
.



Relevant Pages