In this article, we will see how to read system variables in Java.
Java got a Properties object that gets information about local system and configuration. In java, that is called System Properties.
Lets see it in the code.
System.getenv("Systemroot");
Lets see it in a java example.
In above example, we print to terminal system variable "systemroot", as it shows root folder of our system.