{"record":{"id":"cd5600a47f4da24d","repo":"NationalSecurityAgency/ghidra","slug":"failed-to-find-the-jython-home-directory-at-jyth","errorCode":null,"errorMessage":"Failed to find the jython home directory at: {jythonHomeDir}","messagePattern":"Failed to find the jython home directory at: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"critical","filePath":"Ghidra/Extensions/Jython/src/main/java/ghidra/jython/JythonUtils.java","lineNumber":48,"sourceCode":"\tpublic static final String JYTHON_NAME = \"jython-2.7.4\";\n\tpublic static final String JYTHON_CACHEDIR = \"jython_cachedir\";\n\tpublic static final String JYTHON_SRC = \"jython-src\";\n\n\t/**\n\t * Sets up the jython home directory.  This is the directory that has the \"Lib\" directory in it.\n\t *  \n\t * @return The jython home directory.\n\t * @throws IOException If there was a disk-related problem setting up the home directory.\n\t */\n\tpublic static File setupJythonHomeDir() throws IOException {\n\n\t\tFile jythonModuleDir = Application.getMyModuleRootDirectory().getFile(false);\n\t\tFile jythonHomeDir =\n\t\t\tApplication.getModuleDataSubDirectory(jythonModuleDir.getName(), JYTHON_NAME)\n\t\t\t\t\t.getFile(false);\n\n\t\tif (!jythonHomeDir.exists()) {\n\t\t\tthrow new IOException(\"Failed to find the jython home directory at: \" + jythonHomeDir);\n\t\t}\n\n\t\tSystem.setProperty(\"jython.home\", jythonHomeDir.getAbsolutePath());\n\n\t\treturn jythonHomeDir;\n\t}\n\n\t/**\n\t * Sets up the jython cache directory.  This is a temporary space that jython source files\n\t * get compiled to and cached.  It should NOT be in the Ghidra installation directory, because\n\t * some installations will not have the appropriate directory permissions to create new files in.\n\t * \n\t * @param monitor A monitor to use during the cache directory setup.\n\t * @return The jython cache directory.\n\t * @throws IOException If there was a disk-related problem setting up the cache directory.\n\t * @throws CancelledException If the user cancelled the setup.\n\t */\n\tpublic static File setupJythonCacheDir(TaskMonitor monitor)","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Extensions/Jython/src/main/java/ghidra/jython/JythonUtils.java#L30-L66","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Reinstall or fully extract the Jython extension so the jython-2.7.4 data directory exists under the module's data folder.","If in development mode, run the Gradle task that assembles Jython module data (processResources / extension build) so jython-2.7.4 is populated.","Verify the module root and Application.getModuleDataSubDirectory resolve to the expected location and that read permissions allow listing it."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"import ghidra.framework.Application;\nimport java.io.File;\nFile moduleRoot = Application.getMyModuleRootDirectory().getFile(false);\nFile home = Application.getModuleDataSubDirectory(moduleRoot.getName(), \"jython-2.7.4\").getFile(false);\nif (!home.exists()) {\n    // do not attempt interpreter init; reinstall the Jython extension data\n}","typeGuard":"null","tryCatchPattern":"try {\n    GhidraJythonInterpreter.get();\n} catch (Exception e) {\n    // get() logs and returns null on failure; check install of jython-2.7.4 data\n}","preventionTips":["Install the Jython extension fully (data included) before first use.","In CI/dev, run the build task that populates module data.","Keep the module data directory read-accessible to the running user."],"tags":["jython","installation","module-data","environment"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}