java.lang.System.getEnv()

Erik Poupaert erik.poupaert@skynet.be
Wed Mar 3 19:22:00 GMT 2004


Hi,
For my cgi-bin project I need to pick up the environment variables that Apache
provides.
I'm now either up to using one of the gazillion libraries, such as libgetenv-java,
that you find on the web, or else resort to reading /proc/self/environ, or otherwise
working my way around this problem.
Would you accept a patch to solve it?
 /**
 * This used to get an environment variable, but following Sun's lead,
 * it now throws an Error. Use <code>getProperty</code> instead.
 *
 * @param name the name of the environment variable
 * @return this does not return
 * @throws Error this is not supported
 * @deprecated use {@link #getProperty(String)}; getenv is not supported
 */
 public static String getenv(String name)
 {
 throw new Error("getenv no longer supported, use properties instead: "
 + name);
 }
By the way, since "Sun's lead" listens to no one else but themselves -- and even
then, not always -- and prefers to throw Error tantrums around, let's hope that
IBM will be able to talk some reason into them.
Greetings
Erik


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /