NationalSecurityAgency/ghidra · critical · IOException

Failed to find the jython home directory at: {jythonHomeDir}

Error message

Failed to find the jython home directory at: {jythonHomeDir}

What it means

Thrown by JythonUtils.setupJythonHomeDir() when the module data subdirectory named 'jython-2.7.4' (JYTHON_NAME) does not exist on disk. This directory holds Jython's Lib/ tree and is required before the interpreter can start. setupJythonHomeDir runs during GhidraJythonInterpreter.get() initialization.

Source

Thrown at Ghidra/Extensions/Jython/src/main/java/ghidra/jython/JythonUtils.java:48

	public static final String JYTHON_NAME = "jython-2.7.4";
	public static final String JYTHON_CACHEDIR = "jython_cachedir";
	public static final String JYTHON_SRC = "jython-src";

	/**
	 * Sets up the jython home directory.  This is the directory that has the "Lib" directory in it.
	 *  
	 * @return The jython home directory.
	 * @throws IOException If there was a disk-related problem setting up the home directory.
	 */
	public static File setupJythonHomeDir() throws IOException {

		File jythonModuleDir = Application.getMyModuleRootDirectory().getFile(false);
		File jythonHomeDir =
			Application.getModuleDataSubDirectory(jythonModuleDir.getName(), JYTHON_NAME)
					.getFile(false);

		if (!jythonHomeDir.exists()) {
			throw new IOException("Failed to find the jython home directory at: " + jythonHomeDir);
		}

		System.setProperty("jython.home", jythonHomeDir.getAbsolutePath());

		return jythonHomeDir;
	}

	/**
	 * Sets up the jython cache directory.  This is a temporary space that jython source files
	 * get compiled to and cached.  It should NOT be in the Ghidra installation directory, because
	 * some installations will not have the appropriate directory permissions to create new files in.
	 * 
	 * @param monitor A monitor to use during the cache directory setup.
	 * @return The jython cache directory.
	 * @throws IOException If there was a disk-related problem setting up the cache directory.
	 * @throws CancelledException If the user cancelled the setup.
	 */
	public static File setupJythonCacheDir(TaskMonitor monitor)

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Reinstall or fully extract the Jython extension so the jython-2.7.4 data directory exists under the module's data folder.
  2. If in development mode, run the Gradle task that assembles Jython module data (processResources / extension build) so jython-2.7.4 is populated.
  3. Verify the module root and Application.getModuleDataSubDirectory resolve to the expected location and that read permissions allow listing it.

Example fix

null
Defensive patterns

Strategy: validation

Validate before calling

import ghidra.framework.Application;
import java.io.File;
File moduleRoot = Application.getMyModuleRootDirectory().getFile(false);
File home = Application.getModuleDataSubDirectory(moduleRoot.getName(), "jython-2.7.4").getFile(false);
if (!home.exists()) {
    // do not attempt interpreter init; reinstall the Jython extension data
}

Type guard

null

Try / catch

try {
    GhidraJythonInterpreter.get();
} catch (Exception e) {
    // get() logs and returns null on failure; check install of jython-2.7.4 data
}

Prevention

When it happens

Trigger: First Jython interpreter creation in a Ghidra installation where the Jython extension data (jython-2.7.4) was never installed, partially installed, or deleted; running from a source/dev layout where the module data was not built/copied.

Common situations: Fresh Ghidra install with the Jython extension not fully extracted; a custom/trimmed distribution that omitted the jython data directory; upgrading Ghidra and the extension data did not migrate; filesystem permission issue preventing the directory from being seen.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/cd5600a47f4da24d. Report an issue: GitHub.