在哪里放置Java applet的政策文件? [英] Where to place java applet policy file?
问题描述
我工作的人工智能项目,是一个逻辑游戏,目的是两个用户连接到谁充当管理员,然后开始逐个依次播放网络上的服务器。
I am working on an artificial intelligence project which is a logic game and aims two user connecting to the server on the network who acts as an Admin and then start to play one by one.
为了创建连接,我有一个服务器code这只是听在localhost:8000和他们到达指定团队价值观给客户。连接后,客户使他们的管理控制下的举动。
In order to create connections, i have a server code which is just listening on localhost:8000 and assigning team values to the clients as they arrive. After connecting, clients make their move under Admin's control.
现在的问题是,当我试图把我的code中失败,出现以下错误的浏览器工作:
The question is that when i try to put my code to work in the browser it fails with the following error:
java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:8000 connect,resolve)
即使我已经创建了自己的政策,第一只授予套接字访问权限设置为我的项目文件夹中的codeBase的(的file:///家用/ XXX /项目/ -
)后,没有工作我授予的所有的距离的所有的codeBase的权限。我试图把我的政策文件,无论是在主目录,并在我的小程序code所在的同一目录下。
Even though i have created my own policy, first granting only Socket access permission to the codebase of my project folder (file:///home/xxx/projects/-
), after it didn't work i granted all permissions from all codebase. I tried placing my policy file both in the home directory and in the same directory where my applet code resides.
鸭preciate任何提示,谢谢。
Appreciate any tips, thanks.
推荐答案
默认情况下,我认为它会在你的home目录名为.java.policy的文件
by default I think it looks for a file named .java.policy in your home directory
您可以检查该文件/lib/security/java.security,看看它的样子。
检查键名为policy.url.n
you can check the file /lib/security/java.security to see where it looks. check the keys named policy.url.n
这篇关于在哪里放置Java applet的政策文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!