The Java Tutorials have been written for JDK 8. Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.
See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.
This step uses the Policy Tool utility to open the policy file named examplepolicy
created in the
Creating a Policy File lesson. You will add a new policy entry granting permission for code from the directory where GetProps.class
is stored to read the "user.home"
and the "java.home"
property values, as shown in the following figure.
The steps are as follows.
examplepolicy
file from the test
directory in your home directory.file:${user.home}/test/
for file:/C:/Test/
. Alternatively you could directly specify your home directory rather than referring to the "user.home"
property, as in file:/home/jones/test/
.