private static @Nullable JdkVersionInfo detectFromRelease(String homePath) {
    final Path releaseFile;
    try {
      releaseFile = Paths.get(homePath, "release");
    } catch (InvalidPathException ignored) {
      return null;
    }

    if (Files.isRegularFile(releaseFile)) {
      Properties p = new Properties();
      try (InputStream stream = Files.newInputStream(releaseFile)) {
        p.load(stream);
        String versionString = p.getProperty("JAVA_FULL_VERSION", p.getProperty("JAVA_VERSION"));
        if (versionString != null) {
          JavaVersion version = JavaVersion.parse(versionString);

          Variant variant = detectVariant(p);
          if (variant == null && version.feature < 9) {
            // pre-modular release files rarely contain enough information
            JdkVersionInfo fromJar = detectFromJar(homePath);
            if (fromJar != null) variant = fromJar.variant;
          }

          CpuArch arch = CpuArch.fromString(unquoteProperty(p, "OS_ARCH"));

          return new JdkVersionInfo(version, variant, arch, unquoteProperty(p, "GRAALVM_VERSION"));
        }
      }
      catch (IOException | IllegalArgumentException e) {
        LOG.info(releaseFile.toString(), e);
      }
    }

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