public static IJavaProject createEmptyGhidraProject(String projectName, File projectDir,
			boolean createRunConfig, String runConfigMemory, GhidraApplicationLayout ghidraLayout,
			ProjectPythonInterpreter pythonInterpreter, IProgressMonitor monitor)
			throws IOException, ParseException, CoreException {

		// Get Ghidra's Java configuration
		AppConfig appConfig =
			new AppConfig(ghidraLayout.getApplicationInstallationDir().getFile(false));

		// Make new Java project
		IWorkspace workspace = ResourcesPlugin.getWorkspace();
		IProject project = workspace.getRoot().getProject(projectName);
		IProjectDescription projectDescription = workspace.newProjectDescription(projectName);
		projectDescription.setLocation(new Path(projectDir.getAbsolutePath()));
		projectDescription.setNatureIds(new String[] { JavaCore.NATURE_ID });
		ICommand command = projectDescription.newCommand();
		command.setBuilderName(JavaCore.BUILDER_ID);
		projectDescription.setBuildSpec(new ICommand[] { command });
		project.create(projectDescription, monitor);
		IJavaProject javaProject = JavaCore.create(project);
		project.open(monitor);

		// Set the project's default encoding
		project.setDefaultCharset(StandardCharsets.UTF_8.displayName(), monitor);

		// Clear the project's classpath
		javaProject.setRawClasspath(new IClasspathEntry[0], monitor);

		// Configure Java compiler for the project
		configureJavaCompiler(javaProject, appConfig);

		// Setup default bin folder
		IFolder binFolder = project.getFolder("bin/default");
		javaProject.setOutputLocation(binFolder.getFullPath(), monitor);

		// Add Eclipse's built-in JUnit to classpath
		addToClasspath(javaProject, JavaCore.newContainerEntry(JUnitCore.JUNIT4_CONTAINER_PATH),
			monitor);

		// Link in Ghidra to the project
		linkGhidraToProject(javaProject, ghidraLayout, appConfig, pythonInterpreter, monitor);

		// Create run configuration (if necessary)
		if (createRunConfig) {
			try {
				ILaunchConfiguration launchConfig =
					GhidraLaunchUtils.createLaunchConfig(javaProject, GhidraLaunchUtils.GUI_LAUNCH,
						project.getName(), runConfigMemory).doSave();
				GhidraLaunchUtils.addToFavorites(launchConfig);
			}
			catch (CoreException e) {
				EclipseMessageUtils.showErrorDialog(
					"Failed to create a Ghidra run configuration for the new project.  Please do it manually.");
			}
		}

		return javaProject;
	}
Creates a new empty Ghidra project with the given name.

@param projectName The name of the project to create.
@param projectDir The directory the project will be created in.
@param createRunConfig Whether or not to create a new run configuration for the project.
@param runConfigMemory The run configuration's desired memory.  Could be null.
@param ghidraLayout The Ghidra layout to link the project to.
@param pythonInterpreter The Python interpreter to use.
@param monitor The progress monitor to use during project creation.
@return The created project.
@throws IOException If there was a file-related problem with creating the project.
@throws ParseException If there was a parse-related problem with creating the project.
@throws CoreException If there was an Eclipse-related problem with creating the project.
GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/src/main/java/ghidradev/ghidraprojectcreator/utils/GhidraProjectUtils.java