I am running a java app as follows and my policy file is in the same folder and it gives the following error. if I run it without specifying policy related parameters, it runs fine. any idea what I am doing wrong here and how to fix it? thanks.
Error: Could not find or load main class –Djava.security.policy==quantanywhere.policy
java -Djava.security.manager –Djava.security.policy==my.policy -jar myapp.jar
my.policy file contents:
grant {
permission java.security.AllPermission;
};
i got it..
#1 create a policy file and give all permissions
#2 specify that policy file in command line
#3 create a custom security manager class
#4 activate your custom security manager
#5 that's it. your app can no longer execute shell commands/scripts