设置策略文件以授予所需的权限

原文: https://docs.oracle.com/javase/tutorial/security/tour1/step2.html

策略文件是 ASCII 文本文件,可以通过文本编辑器或本节中演示的图形策略工具实用程序来编写。策略工具可以节省您的输入,使您无需了解策略文件所需的语法,从而减少错误。

本课程使用策略工具创建名为 examplepolicy 的策略文件,您将在其中添加策略条目,该条目授予来自 examples 的代码目录写入权限。

请按照以下步骤创建和修改新的策略文件:

  1. 启动政策工具
  2. 授予所需许可
  3. 保存策略文件

Note for UNIX Users: The steps illustrate creating the policy file for a Windows system. The steps are exactly the same if you are working on a UNIX system. Where the text says to store the policy file in the C:\Test directory, you can store it in another directory. The examples in the lesson Quick Tour of Controlling Applications assume that you stored it in the ~/test directory.