@Override
  public ImmutableList<String> computeEntrypoint(List<String> jvmFlags) throws IOException {
    try (JarFile jarFile = new JarFile(jarPath.toFile())) {
      String mainClass =
          jarFile.getManifest().getMainAttributes().getValue(Attributes.Name.MAIN_CLASS);
      if (mainClass == null) {
        throw new IllegalArgumentException(
            "`Main-Class:` attribute for an application main class not defined in the input JAR's "
                + "manifest (`META-INF/MANIFEST.MF` in the JAR).");
      }
      ImmutableList.Builder<String> entrypoint = ImmutableList.builder();
      entrypoint.add("java");
      entrypoint.addAll(jvmFlags);
      entrypoint.add("-jar");
      entrypoint.add(JarLayers.APP_ROOT + "/" + jarPath.getFileName().toString());
      return entrypoint.build();
    }
  }
@Test
  public void testComputeEntrypoint_withMainClass_jvmFlags()
      throws IOException, URISyntaxException {
    Path standardJar =
        Paths.get(Resources.getResource(STANDARD_JAR_WITH_CLASS_PATH_MANIFEST).toURI());
    StandardPackagedProcessor standardPackagedModeProcessor =
        new StandardPackagedProcessor(standardJar, JAR_JAVA_VERSION);

    ImmutableList<String> actualEntrypoint =
        standardPackagedModeProcessor.computeEntrypoint(ImmutableList.of("-jvm-flag"));

    assertThat(actualEntrypoint)
        .isEqualTo(
            ImmutableList.of("java", "-jvm-flag", "-jar", "/app/standardJarWithClassPath.jar"));
  }