This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
java.lang.System.getEnv()
- From: Erik Poupaert <erik dot poupaert at skynet dot be>
- To: java at gcc dot gnu dot org
- Date: Wed, 3 Mar 2004 20:17:30 +0000
- Subject: java.lang.System.getEnv()
- Organization: Erik Poupaert
- References: <E1Av4SR-0002aD-00@megacz.com><Pine.LNX.4.44.0402222049540.4733-100000@ops2.one-point.com>
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