Java processes: Difference between revisions

From wikinotes
No edit summary
 
m (Will moved page Java system to Java processes without leaving a redirect)
 
(No difference)

Latest revision as of 02:40, 24 June 2022

Environment Variables

import java.util.Map;

Map<String> env = System.getenv();    // get all environment variables
System.getenv("HOME");                // get environment variable "HOME" (returns String, or NULL)

NOTE:
java does not let you set environment variables, preferring that you spawn a subshell with a modified environment

Commandline Arguments

Java does not include an argument parser in it's standard library. I recommend apache's java commons cli.