title: How to disable Java security manager?
body: <p>Is there any way to completely disable Java security manager? <br/></p>
  
  <p>I'm experimenting with source code of db4o. It uses reflection to persist objects and it seems that security manager doesn't allow reflection to read and write private or protected fields.</p>
  
  <p>My code:</p>
  
  <pre><code>public static void main(String[] args) throws IOException {
      System.out.println("start");
      new File( DB_FILE_NAME ).delete();
      ObjectContainer container = Db4o.openFile( DB_FILE_NAME );
      String ob = new String( "test" );
      container.store( ob );
      ObjectSet result = container.queryByExample( String.class );
      System.out.println( "retrieved (" + result.size() + "):" );
      while( result.hasNext() ) {
          System.out.println( result.next() );
      }
      container.close();
      System.out.println("finish");
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre>
  start
  [db4o 7.4.68.12069   2009-04-18 00:21:30] 
   AccessibleObject#setAccessible() is not available. Private fields can not be stored.
  retrieved (0):
  finish
  </pre>
  
  <p><br/>
  <a href="http://developer.db4o.com/forums/permalink/10482/10482/ShowThread.aspx" rel="noreferrer"> This thread </a> suggests modifying java.policy file to allow reflection but it doesn't seem to work for me.</p>
  
  <p>I'm starting JVM with arguments<br>
  <code>-Djava.security.manager -Djava.security.policy==/home/pablo/.java.policy</code> <br/>
  so specified policy file will be the only policy file used</p>
  
  <p>The file looks like this:</p>
  
  <pre>
  grant {
      permission java.security.AllPermission;
      permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
  };
  </pre>
  
  <p>I spent last 3 hrs on this and don't have any ideas how to make this work.
  Any help appreciated.</p>