O'Reilly logo

Java™ Phrasebook by Timothy Fisher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting Environment Variables

String envPath = System.getenv("PATH");

This phrase shows how you can retrieve an environment variable using the System.getenv() method. This method was deprecated in versions of JDK 1.2 through 1.4. In JDK 1.5, Sun did something that they don’t do too often and they undeprecated this method. If you are using a version of the JDK that has this method deprecated, at compile time, you will get deprecation warnings if you attempt to use this method. A deprecated method is a method that should not be used in new development projects, but is supported for backward compatibility purposes. There is no guarantee that deprecated methods will continue to be supported in future versions of the JDK. But again, in the case of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required