public List<File> findSupportedJavaHomeFromInstallations(AppConfig appConfig,
			JavaFilter javaFilter) {
		Set<File> potentialJavaHomeSet = new TreeSet<>();
		for (File javaRootInstallDir : getJavaRootInstallDirs()) {
			if (javaRootInstallDir.isDirectory()) {
				for (File dir : javaRootInstallDir.listFiles()) {
					if (dir.isDirectory()) {
						dir = new File(dir, getJavaHomeSubDirPath());
						if (javaFilter.equals(JavaFilter.ANY) ||
							javaFilter.equals(JavaFilter.JDK_ONLY)) {
							potentialJavaHomeSet.add(getJdkHomeFromJavaHome(dir));
						}
						if (javaFilter.equals(JavaFilter.ANY) ||
							javaFilter.equals(JavaFilter.JRE_ONLY)) {
							potentialJavaHomeSet.add(getJreHomeFromJavaHome(dir));
						}
					}
				}
			}
		}
		final Map<File, JavaVersion> javaHomeToVersionMap = new HashMap<>();
		for (File potentialJavaHomeDir : potentialJavaHomeSet) {
			try {
				JavaVersion javaVersion =
					appConfig.getJavaVersion(potentialJavaHomeDir, javaFilter);
				if (appConfig.isJavaVersionSupported(javaVersion)) {
					javaHomeToVersionMap.put(potentialJavaHomeDir, javaVersion);
				}
			}
			catch (ParseException | IOException e) {
				// skip it
			}
		}
		List<File> javaHomeDirs = new ArrayList<>(javaHomeToVersionMap.keySet());
		Collections.sort(javaHomeDirs, new Comparator<File>() {
			@Override
			public int compare(File dir1, File dir2) {
				return javaHomeToVersionMap.get(dir2).compareTo(javaHomeToVersionMap.get(dir1));
			}
		});
		return javaHomeDirs;
	}
Returns a list of supported Java home directories from discovered Java installations.
The list is sorted from newest Java version to oldest.

@param appConfig The appConfig configuration that defines what we support.
@param javaFilter A filter used to restrict what kind of Java installations we search for.
@return A sorted list of supported Java home directories from discovered Java installations.
GhidraBuild/LaunchSupport/src/main/java/ghidra/launch/JavaFinder.java