jstatd 啓動報錯解決:Could not create remote object

在命令行執行jstatd提示以下信息java

Could not create remote object
access denied ("java.util.PropertyPermission" "java.rmi.server.ignoreSubClasses"
 "write")
java.security.AccessControlException: access denied ("java.util.PropertyPermissi
on" "java.rmi.server.ignoreSubClasses" "write")
        at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:472)
        at java.security.AccessController.checkPermission(AccessController.java:
884)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
        at java.lang.System.setProperty(System.java:792)
        at sun.tools.jstatd.Jstatd.main(Jstatd.java:139)

能夠建立一個文件,好比D:\tools.policy,修改tools.policy文件的內容爲命令行

grant codebase "file:${java.home}/../lib/tools.jar" {
   permission java.security.AllPermission;
};

命令行窗口執行jstatd -J-Djava.security.policy=D:\tools.policycode

jstatd成功啓動server

相關文章
相關標籤/搜索