12.3. Setting System and Security Properties

Some items are customized by setting system properties, whereas others are customized by setting security properties. The following sections explain how to set values for both types of properties.

12.3.1. Setting System Properties

You can set a system property either statically or dynamically. To set a system property statically, use the -D option of the java command. For example, to run an application named MyApp and set the user.home system property to specify the user home directory /home/marys, enter the following:

java -Duser.home=/home/marys MyApp

To set a system property dynamically, call the java.lang.System.setProperty method in your code, substituting the appropriate property name and ...

Get Inside Java™ 2 Platform Security: Architecture, API Design, and Implementation, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.