Forum Stats

  • 3,838,749 Users
  • 2,262,397 Discussions
  • 7,900,750 Comments

Discussions

Regular expression in java.policy file

I have a third party security provider jar that docs recommend to be placed into the jre/lib/ext folder.  While it can be placed elsewhere in the general class path the docs of this library make it clear that exceptions could result depending on classloader start order etc.

The default java.policy has the following

grant codeBase "file:${{java.ext.dirs}}/*" {

  permission java.security.AllPermission;

};

However, if I place my provider jar in the extension folder I do not AllPermission to applied to my provider jar.  Ideally I want to wild card the file param of grant codeBase.  i.e. all files exception the security provider.

Otherwise do I really have to list the following for each jar ?

grant codeBase "file:${{java.ext.dirs}}/jar1.jar" {

  permission java.security.AllPermission;

};

grant codeBase "file:${{java.ext.dirs}}/jart2.jar" {

  permission java.security.AllPermission;

};

Thank you

This discussion has been closed.