Creating a Policy File

Java 2 provides a tool to make it easy to create a policy file. It is called the policy tool. To run the policy tool, go to the command line and type

policytool

On most systems, this will bring up the policy tool, along with an error message, such as Could not find Policy file: C:\Windows\.java.policy. Just click OK. It's not really a problem. Figure 16.1 shows the policy tool when you first start it.

Figure 16.1. The main Policy Tool screen.

To make this practical, I will step through making a policy file.

  1. Click Add Policy Entry. This brings up a dialog box in which you can select permissions, as shown in Figure 16.2 ...

Get PURE Java™ 2 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.