Java argument to specify Java.Security file for JVM

后端 未结 3 402
花落未央
花落未央 2020-12-30 05:29

I\'m looking for a java argument (or perhaps some different method) to allow me to specify a file to be used by the JVM as the java.security file, rather than using the one

相关标签:
3条回答
  • 2020-12-30 06:00

    Looking at the OpenJDK source, you cannot change the loading of the java.security file. However, that file has a property called security.overridePropertiesFile which, if set to true (as it is in my current, vanilla install), allows you to load an additional security properties file specified through the system property named java.security.properties. Note also, that the command line syntax follows a similar pattern to the policy file where = specifies additional configuration and == specifies a complete replacement configuration.

    0 讨论(0)
  • 2020-12-30 06:03

    You can just set the system property -Djava.security.properties=***** to specify the security property you want to load, but you must set the property security.overridePropertiesFile=true prior to use this approach.

    0 讨论(0)
  • 2020-12-30 06:07

    Maybe the accepted answer on this thread would help you out; basically it says that you need to specify your own policy file and the final invocation should look like:

    java -Djava.security.manager -Djava.security.policy=/some/path/my.policy
    
    0 讨论(0)
提交回复
热议问题