private static @Nullable JdkVersionInfo detectFromJar(String homePath) {
    Path rtFile = Paths.get(homePath, "jre/lib/rt.jar");
    if (Files.isRegularFile(rtFile)) {
      try (JarFile rtJar = new JarFile(rtFile.toFile(), false)) {
        Manifest manifest = rtJar.getManifest();
        if (manifest != null) {
          String versionString = manifest.getMainAttributes().getValue(Attributes.Name.IMPLEMENTATION_VERSION);
          if (versionString != null) {
            JavaVersion version = JavaVersion.parse(versionString);
            boolean x64 = SystemInfo.isMac || Files.isDirectory(rtFile.resolveSibling("amd64"));
            String vendorString = manifest.getMainAttributes().getValue(Attributes.Name.IMPLEMENTATION_VENDOR);
            Variant variant = vendorString != null ? detectVendor(vendorString) : null;
            return new JdkVersionInfo(version, variant, x64 ? CpuArch.X86_64 : CpuArch.UNKNOWN, null);
          }
        }
      }
      catch (IOException | IllegalArgumentException e) {
        LOG.info(rtFile.toString(), e);
      }
    }

    return null;
  }
private static @Nullable JdkVersionInfo detectFromJar(String homePath)