public void compile(File javaFile) {
		String name = javaFile.getName();
		String className = name.substring(0, name.indexOf(".")) + ".class";

		File parent = javaFile.getParentFile();
		String parentPath = parent.getAbsolutePath();
		int pos = parentPath.lastIndexOf("ghidra");
		String destPath = parentPath.substring(0, pos - 1);

		javaFile.deleteOnExit();

		File classFile = new File(parent, className);
		classFile.deleteOnExit();

		String classpath = System.getProperty("java.class.path");
		String javaLoc = System.getProperty("java.home");
		if (javaLoc.endsWith("jre")) {
			javaLoc = javaLoc.substring(0, javaLoc.indexOf("jre") - 1);
		}
		String argV[] = new String[6];
		argV[0] = javaLoc + File.separator + "bin" + File.separator + "javac";
		argV[1] = "-classpath";
		argV[2] = classpath;
		argV[3] = "-d";
		argV[4] = destPath;
		argV[5] = javaFile.getAbsolutePath();
		try {
			Process p = Runtime.getRuntime().exec(argV);
			for (String element : argV) {
				System.out.print(element + " ");
			}
			System.out.println();

			InputStream stderrStream = p.getErrorStream();
			InputStream stdinStream = p.getInputStream();

			setupIO(stdinStream, stderrStream);
			p.waitFor();

			cmdOut.join();
			cmdErr.join();

		}
		catch (Exception e) {
			e.printStackTrace();
		}

	}
Compile a java file; deletes the java file and the class file when the
junit exits.
Ghidra/Features/Base/src/test/java/ghidra/test/JavaCompiler.java