-
java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.0.x:8080 connect,resolve)
解决方法:
修改jre\lib\security\java.policy策略文件,在grant {},大括号中加上:
-
grant {
-
permission java.net.SocketPermission "192.168.0.x:8080","connect,resolve";
-
}
或者将以上内容保存为文件my.policy,运行程序时指定参数:
-
java -Djava.security.policy=/path/of/my.policy Main
阅读(2463) | 评论(0) | 转发(0) |