Created
February 7, 2016 14:47
-
-
Save baluragala/7b008605109fcea59505 to your computer and use it in GitHub Desktop.
Print value for a given environment variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Map; | |
import java.util.Properties; | |
/** | |
* Created by moksha on 07/02/16. | |
*/ | |
public class JavaEnvironmentVariables { | |
public static void main(String args[]){ | |
Map<String, String> enviorntmentVars = System.getenv(); | |
String value = enviorntmentVars.get("TMPDIR"); | |
System.out.println(String.format("Value for %s Key is %s","TMPDIR",value)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment