发布于 4年前

jstatd 启动报错解决:Could not create remote object

在命令行执行jstatd提示如下信息

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.policy

jstatd成功启动

©2020 edoou.com   京ICP备16001874号-3