public JavaVersion getJavaVersion(File javaHomeDir, JavaFilter javaFilter)
			throws FileNotFoundException, IOException, ParseException {

		if (javaHomeDir == null) {
			throw new FileNotFoundException("Directory not specified");
		}

		if (!javaHomeDir.isDirectory()) {
			throw new FileNotFoundException("Not a directory");
		}

		File binDir = new File(javaHomeDir, "bin");
		if (!binDir.isDirectory()) {
			throw new FileNotFoundException("Missing bin directory");
		}

		File javaExecutable = null;
		File javacExecutable = null;
		for (File f : binDir.listFiles()) {
			if (f.getName().equals("java") || f.getName().equals("java.exe")) {
				javaExecutable = f;
			}
			if (f.getName().equals("javac") || f.getName().equals("javac.exe")) {
				javacExecutable = f;
			}
		}
		if (javaExecutable == null) {
			throw new FileNotFoundException("Missing java executable");
		}
		if (javaFilter.equals(JavaFilter.JDK_ONLY) && javacExecutable == null) {
			throw new FileNotFoundException("JDK is missing javac executable");
		}
		if (javaFilter.equals(JavaFilter.JRE_ONLY) && javacExecutable != null) {
			throw new FileNotFoundException("JRE should not have javac executable");
		}

		return runAndGetJavaVersion(javaExecutable);
	}
Gets the Java version of the given Java home directory.

@param javaHomeDir The Java home directory to get the version of.
@param javaFilter A filter used to restrict what kind of Java installations we support.
@return The Java version of the given Java home directory.
@throws FileNotFoundException if the given directory is missing a required Java file
  or directory based on the provided filter.  The exception's message will have more 
  details.
@throws IOException if there was a problem executing the java executable with the 
  "-version" argument.
@throws ParseException if the version string failed to parse.
GhidraBuild/LaunchSupport/src/main/java/ghidra/launch/AppConfig.java