String JavaHomeValue = System.getenv("JAVA_HOME") String pathValue = System.getenv("PATH") String tempDir = System.getenv("TMPDIR") String shellValue = System.getenv("SHELL") * java Program to read system environment variables in Java Just need to call the getenv() method and pass the env variable name to it. In the following program, we are going to retrieve PATH, JAVA_HOME, Temporary directory and SHELL from mac os env variables. Java Program to read PATH, JAVA_HOME and TEMP Environment Variables
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |