Skip to content

CAUTION: This site hosts draft documentation for the next release. For published content of the latest release, visit

Using system property command-line options

Java™ system properties determine the environment in which a Java program runs by starting a Java virtual machine with a set of values. You can choose to use the default values for Java system properties or you can specify values for them by adding parameters to the command line when you start your application.

To set a system property from the command line, use:

java -D<property_name>=<value> <program_name>

For example, to specify the UTF-8 file encoding for your application MyProgram, use:

java -Dfile.encoding=UTF-8 MyProgram