public static GhidraApplicationLayout initializeGhidraEnvironment()
			throws IOException, ClassNotFoundException {

		// Make sure our class loader is being used
		if (!(ClassLoader.getSystemClassLoader() instanceof GhidraClassLoader)) {
			throw new ClassNotFoundException("Ghidra class loader not in use.  " +
				"Confirm JVM argument \"-Djava.system.class.loader argument=" +
				GhidraClassLoader.class.getName() + "\" is set.");
		}
		GhidraClassLoader loader = (GhidraClassLoader) ClassLoader.getSystemClassLoader();

		// Get application layout
		GhidraApplicationLayout layout = new GhidraApplicationLayout();

		// Get the classpath
		List<String> classpathList = buildClasspath(layout);

		// Add the classpath to the class loader
		classpathList.forEach(loader::addPath);

		return layout;
	}
Initializes the Ghidra environment by discovering its {@link GhidraApplicationLayout layout}
and adding all relevant modules and libraries to the classpath
<p>
NOTE: This method expects that the {@link GhidraClassLoader} is the active classloader

@return Ghidra's {@link GhidraApplicationLayout layout}
@throws IOException if there was an issue getting the {@link GhidraApplicationLayout layout}
@throws ClassNotFoundException if the {@link GhidraClassLoader} is not the active classloader
Ghidra/Framework/Utility/src/main/java/ghidra/GhidraLauncher.java