code: private JavacEnvironment createEnvironment(List<File> files, List<JavaFileObject> fileObjects,
        boolean processAnnotations) throws IOException {
      JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
      DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
      StandardJavaFileManager fileManager = getFileManager(compiler, diagnostics);
      List<String> javacOptions = getJavacOptions(processAnnotations);
      if (fileObjects == null) {
        fileObjects = new ArrayList<>();
      }
      for (JavaFileObject jfo : fileManager.getJavaFileObjectsFromFiles(files)) {
        fileObjects.add(filterJavaFileObject(jfo));
      }
      JavacTask task = (JavacTask) compiler.getTask(null, fileManager, diagnostics,
          javacOptions, null, fileObjects);
      return new JavacEnvironment(task, fileManager, diagnostics);
    }
docs: Creates a javac environment from a collection of files and/or file objects.