code: public static void preRegister(Context context) {
          context.put(JavaFileManager.class, new Context.Factory<JavaFileManager>() {
              public JavaFileManager make(Context c) {
                  return new JavacFileManager(c, true, null);
              }
          });
      }
docs: Register a Context.Factory to create a JavacFileManager.