exception - Java Security Manager grand permissions not working -
java code:
public class test { public static void main(string[] agrs) { system.out.print("123"); } }
policy:
grant codebase "file:/users/workspace/test/src/*" { permission java.security.allpermission; };
jvm arg:
-djava.security.manager -djava.security.policy=my.policy
when running java code, still got access denied exception:
exception in thread "main" java.security.accesscontrolexception: access denied ("java.lang.reflect.reflectpermission" "suppressaccesschecks") @ java.security.accesscontrolcontext.checkpermission(accesscontrolcontext.java:472) @ java.security.accesscontroller.checkpermission(accesscontroller.java:884) @ java.lang.securitymanager.checkpermission(securitymanager.java:549) @ java.lang.reflect.accessibleobject.setaccessible(accessibleobject.java:128) @ com.intellij.rt.execution.application.appmain.main(appmain.java:146) break in console not supported due security permissions: access denied ("java.util.propertypermission" "idea.launcher.bin.path" "read")
process finished exit code 1
Comments
Post a Comment