aspose file tools
The moose likes Java in General and the fly likes System variables Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Reply 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: 19664
    ∞

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 forums
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3219
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
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.


A Convergent Visionary ~ Frank's Punchbarrel Blog ~ LinkedIn profile
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: System variables
 
Similar Threads
Username And password
How to find the system requirement
Copy file
System Design & System Architecture
Change the JVM default ClassLoader