private static int askJavaHome(AppConfig appConfig, JavaFinder javaFinder,
			JavaFilter javaFilter) throws IOException {

		String javaName = javaFilter.equals(JavaFilter.JDK_ONLY) ? "JDK" : "Java";
		String javaRange;
		int min = appConfig.getMinSupportedJava();
		int max = appConfig.getMaxSupportedJava();
		if (min == max) {
			javaRange = min + "";
		}
		else if (max == 0) {
			javaRange = min + "+";
		}
		else {
			javaRange = min + "-" + max;
		}

		System.out.println("******************************************************************");
		System.out
				.println(javaName + " " + javaRange + " (" + appConfig.getSupportedArchitecture() +
					"-bit) could not be found and must be manually chosen!");
		System.out.println("******************************************************************");

		File javaHomeDir = null;
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			boolean supportsDialog =
				!GraphicsEnvironment.isHeadless() && !(javaFinder instanceof MacJavaFinder);
			System.out.print("Enter path to " + javaName + " home directory");
			System.out.print(supportsDialog ? " (ENTER for dialog): " : ": ");
			String line = in.readLine().trim();
			if (supportsDialog && line.isEmpty()) {
				System.out.println("Opening selection dialog...");
				JFileChooser chooser = new JFileChooser();
				chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
				chooser.setDialogTitle("Choose a " + javaName + " home directory");
				if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
					javaHomeDir = chooser.getSelectedFile();
				}
			}
			else if (!line.isEmpty()) {
				javaHomeDir = new File(line);
			}
			else {
				continue;
			}
			try {
				JavaVersion javaVersion = appConfig.getJavaVersion(javaHomeDir, javaFilter);
				if (appConfig.isJavaVersionSupported(javaVersion)) {
					break;
				}
				System.out.println(
					"Java version " + javaVersion + " is outside of supported range: [" +
						javaRange + " " + appConfig.getSupportedArchitecture() + "-bit]");
			}
			catch (FileNotFoundException e) {
				System.out.println(
					"Not a valid " + javaName + " home directory. " + e.getMessage() + "!");
			}
			catch (IOException | ParseException e) {
				System.out.println("Failed to verify Java version. " + e.getMessage() + "!");
			}
		}

		File javaHomeSaveFile = appConfig.saveJavaHome(javaHomeDir);
		System.out.println("Saved changes to " + javaHomeSaveFile);
		return EXIT_SUCCESS;
	}
Handles interacting with the user to choose a Java home directory to use for the launch.  
If a valid Java home directory was successfully determined, it is saved to the user's
Java home save file, and an exit code that indicates success is returned.

@param appConfig The application configuration that defines what we support.  
@param javaFinder The Java finder.
@param javaFilter A filter used to restrict what kind of Java installations we search for.
* @return A suggested exit code based on whether or not a valid Java home directory was
  successfully chosen.
@throws IOException if there was a problem interacting with the user, or saving the java
  home location to disk.
GhidraBuild/LaunchSupport/src/main/java/LaunchSupport.java