System.getenv () method - deprecated or not?

Many places suggest that the System.getenv () JDK method is deprecated. Many places suggest that it was restored.

Is there a better API that provides functionality for getting environment settings in subsequent JDKs?

Or is System.getenv () still the preferred way to get environment variables / properties?

+4
source share
2 answers

System.getenv()and System.getenv(String)were introduced at the very beginning of java, and then deprecated in Java 1.2 (!).

Java 5 (. 4199068), , , , , , , .

+3

Java 8 API docs . getenv(String), . getenv() a Map<String,String>, get(String), getenv(String), , else null, . API , , getenv() Java , getenv(String). , API Java 1.5, .

+1

All Articles