See: java.lang.String)" rel="nofollow">getenv for the new way of doing it.
Tony Alicea Senior Java Web Application Developer, SCPJ2, SCWCD
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6913
posted
0
This is one of those rampant deprecations which really irritates me. By all means recommend System.getProperty for getting program configuration information, but that's not the only use for environment variables. I can now no longer write something as simple as a CGI script in Java without getting deprecation warnings. Similarly for deprecating all the constructors of PrintStream. Imagine a method in which I accept a single parameter, a PrintStream to log errors to. I could pass in System.out, System.err or a PrintStream of my own (say to a file). Except that I can't. I can't make a PrintStream like System.out without getting deprecation warnings. In my view deprecation should only be used where a full and complete replacement is available. In these cases, that's just not true, and we have to live with using deprecated methods. Wake up Sun. Deprecation should not be done lightly.