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?
System.getenv()and System.getenv(String)were introduced at the very beginning of java, and then deprecated in Java 1.2 (!).
System.getenv()
System.getenv(String)
Java 5 (. 4199068), , , , , , , .
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, .
getenv(String)
getenv()
Map<String,String>
get(String)
null