Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Accessing PATH Environment Variable

>> This may be a dumb question, but why can't you use System.getenv("PATH")?

> In Sun's 1.4 jre this is how its implemented;
> 
> public static String getenv(String name) {
> 	throw new Error("getenv no longer supported, use properties and -D
> instead: " + name);
>     }

Strangely enough in 1.5 it is undeprecated again (and seems to work to get
the PATH environment variable), see

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#getenv(java.lang.String)
  versus
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#getenv(java.lang.String)

Yet another reason to switch to 1.5 :-)

Regards,
  Wieant


Back to the top