Java 教程是为 JDK 8 编写的。本页中描述的示例和实践未利用在后续版本中引入的改进。
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/
.