I need to add -Djava.security.policy=myPolicyFile so that my RMI jar would work. Or is there some other way to make that run?
I need to add -Djava.security.policy=myPolicyFile so that my RMI jar would work. Or is
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re wanting to add the -D when someone launches your jar using
java -jar, that’s not possible because it’s not possible to specify JVM options inside the jar:Can I set Java max heap size for running from a jar file?
That said, if you’re in control of the process, you could use
java.security.Policy.setPolicyto manage the policy object yourself.