aspose file tools*
The moose likes Java in General and the fly likes System variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "System variables" Watch "System variables" New topic
Author

System variables

Dave Smith
Greenhorn

Joined: Jan 12, 2000
Posts: 23
How do I read a system environment variable from a java class without using System.getenv cause that is now depreciated
Cheers
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20693
    ∞

Since this doesn't have anything to do with certification, I'm going to move it to the General Java forum where it will probably get more attention.

permaculture Wood Burning Stoves 2.0 - 4-DVD set
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
See: 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: 6920
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.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: System variables