@ApiStatus.Internal
  public static void launch(String[] args, RuntimeModuleRepository repository, ArrayList<Object> startupTimings, long startTimeUnixNano)
    throws Throwable {
    List<Path> bootstrapClasspath = repository.getBootstrapClasspath("intellij.platform.bootstrap");
    startupTimings.add("calculating bootstrap classpath");
    startupTimings.add(System.nanoTime());

    ClassLoader appClassLoader = IntellijLoader.class.getClassLoader();
    if (!(appClassLoader instanceof PathClassLoader)) {
      reportError("JVM for IntelliJ must be started with -Djava.system.class.loader=com.intellij.util.lang.PathClassLoader parameter");
    }
    ((PathClassLoader)appClassLoader).getClassPath().addFiles(bootstrapClasspath);

    String bootstrapClassName = "com.intellij.platform.bootstrap.ModularMain";
    Class<?> bootstrapClass = Class.forName(bootstrapClassName, true, appClassLoader);
    MethodHandle methodHandle = MethodHandles.publicLookup()
      .findStatic(bootstrapClass, "main",
                  MethodType.methodType(void.class, RuntimeModuleRepository.class, String[].class, ArrayList.class, long.class));
    startupTimings.add("obtaining main method handle");
    startupTimings.add(System.nanoTime());

    methodHandle.invokeExact(repository, args, startupTimings, startTimeUnixNano);
  }
@ApiStatus.Internal
  public static void launch(String[] args, RuntimeModuleRepository repository, ArrayList<Object> startupTimings, long startTimeUnixNano)