Search code examples
sbtjava-security-manager

How can I configure, disable, or override the sbt SecurityManager?


I'm trying to embed Apache Derby into an application. When I run it directly from IntelliJ, everything works fine, but sbt run generates the exception:

Caused by: java.security.AccessControlException: access denied org.apache.derby.security.SystemPermission( "engine", "usederbyinternals" )

This seems to relate to the SecurityManager that SBT uses. Are there ways to disable, reconfigure, or override the default SBT SecurityManager?


Solution

  • JGC provided the insight in this question.

    In the relevant app:

    System.setSecurityManager(null)
    

    Alternatively, one could simply provide a preferred security manager in this way.