Environment Variables In Java

Environment Variables In Java


Environment Variables  are variables that are added in any Operating system that can be accessed from anywhere in OS without using the complete(Real) location.
In a java Application System.getenv(); is used to find out the system environment variables


import java.util.Map;

public class EnvMap {
public static void main (String[] args) {
Map<String, String> env = System.getenv();
for (String envName : env.keySet()) {


Leave a Reply

Your email address will not be published. Required fields are marked *