JdkBundle (File bundleHome, boolean boot) { if ("jre".equals(bundleHome.getName())) { File jdk = bundleHome.getParentFile(); if (new File(jdk, "lib").isDirectory()) { bundleHome = jdk; } } File actualHome = bundleHome; if (SystemInfo.isMac) { if (actualHome.getName().equals("Home") && actualHome.getParentFile().getName().equals("Contents")) { bundleHome = actualHome.getParentFile().getParentFile(); } else { File contents = new File(bundleHome, "Contents/Home"); if (contents.isDirectory()) { actualHome = contents; } } } JdkVersionInfo versionInfo; if (boot) { versionInfo = new JdkVersionInfo(JavaVersion.current(), null, CpuArch.CURRENT); } else { versionInfo = JdkVersionDetector.getInstance().detectJdkVersionInfo(actualHome.getPath()); } if (versionInfo != null) { boolean bundled = PathManager.isUnderHomeDirectory(bundleHome.getPath()); boolean jdk = JdkUtil.checkForJdk(actualHome.toPath()); return new JdkBundle(bundleHome, versionInfo, boot, bundled, jdk); } return null; }