private static synchronized @NotNull ExternalJavacManager ensureJavacServerStarted(@NotNull CompileContext context) throws IOException {
    ExternalJavacManager server = ExternalJavacManager.KEY.get(context);
    if (server != null) {
      return server;
    }
    final int listenPort = findFreePort();
    server = new ExternalJavacManager(Utils.getSystemRoot(), SharedThreadPool.getInstance(), 2 * 60 * 1000L /*keep idle builds for 2 minutes*/) {
      @Override
      protected ExternalJavacProcessHandler createProcessHandler(UUID processId, @NotNull Process process, @NotNull String commandLine, boolean keepProcessAlive) {
        return new ExternalJavacProcessHandler(processId, process, commandLine, keepProcessAlive) {
          @Override
          public @NotNull Future<?> executeTask(@NotNull Runnable task) {
            return SharedThreadPool.getInstance().submit(task);
          }

          @Override
          protected @NotNull BaseOutputReader.Options readerOptions() {
            return BaseOutputReader.Options.NON_BLOCKING;
          }
        };
      }
    };
    server.start(listenPort);
    ExternalJavacManager.KEY.set(context, server);
    return server;
  }
private static synchronized @NotNull ExternalJavacManager ensureJavacServerStarted(@NotNull CompileContext context)