{"record":{"id":"433bda535c60aae7","repo":"skylot/jadx","slug":"please-specify-input-file","errorCode":null,"errorMessage":"Please specify input file","messagePattern":"Please specify input file","errorType":"validation","errorClass":"JadxArgsValidateException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/api/JadxArgsValidator.java","lineNumber":29,"sourceCode":"\npublic class JadxArgsValidator {\n\n\tprivate static final Logger LOG = LoggerFactory.getLogger(JadxArgsValidator.class);\n\n\tpublic static void validate(JadxDecompiler jadx) {\n\t\tJadxArgs args = jadx.getArgs();\n\t\tcheckInputFiles(jadx, args);\n\t\tvalidateOutDirs(args);\n\n\t\tif (LOG.isDebugEnabled()) {\n\t\t\tLOG.debug(\"Effective jadx args: {}\", args);\n\t\t}\n\t}\n\n\tprivate static void checkInputFiles(JadxDecompiler jadx, JadxArgs args) {\n\t\tList<File> inputFiles = args.getInputFiles();\n\t\tif (inputFiles.isEmpty() && jadx.getCustomCodeLoaders().isEmpty()) {\n\t\t\tthrow new JadxArgsValidateException(\"Please specify input file\");\n\t\t}\n\t\tfor (File file : inputFiles) {\n\t\t\tcheckFile(file);\n\t\t}\n\t}\n\n\tprivate static void validateOutDirs(JadxArgs args) {\n\t\tFile outDir = args.getOutDir();\n\t\tFile srcDir = args.getOutDirSrc();\n\t\tFile resDir = args.getOutDirRes();\n\t\tif (outDir == null) {\n\t\t\tif (srcDir != null) {\n\t\t\t\toutDir = srcDir;\n\t\t\t} else if (resDir != null) {\n\t\t\t\toutDir = resDir;\n\t\t\t} else {\n\t\t\t\toutDir = makeDirFromInput(args);\n\t\t\t}","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/api/JadxArgsValidator.java#L11-L47","documentation":"An argument-validation error raised by JadxArgsValidator.checkInputFiles() before any decompilation starts. jadx requires at least one input file OR a custom code loader; if args.getInputFiles() is empty and jadx.getCustomCodeLoaders() is also empty, there is nothing to decompile and a JadxArgsValidateException (a RuntimeException) is thrown. This fires during JadxDecompiler initialization/save setup.","triggerScenarios":"Constructing JadxArgs without calling setInputFiles() (or setFiles()/setInput() with a path) and without registering any custom code loader, then calling decompiler.load() or save().","commonSituations":"Programmatic jadx usage where the caller forgot to set input files; a CLI wrapper that clears the args list on a config error; tests that build JadxArgs incrementally and miss the input step.","solutions":["Add at least one input file: args.setInputFiles(List.of(new File(\"app.apk\"))).","Alternatively, register a custom code loader via jadx.addCustomCodeLoader(...) if you supply classes programmatically.","Validate args yourself before calling load() to give a clearer error.","Check that the input-files list is populated and non-empty right before initialization."],"exampleFix":"// before\nJadxArgs args = new JadxArgs();\nargs.setOutDir(new File(\"out\"));\nJadxDecompiler d = new JadxDecompiler(args);\nd.load();\n\n// after\nJadxArgs args = new JadxArgs();\nargs.setInputFiles(List.of(new File(\"app.apk\")));\nargs.setOutDir(new File(\"out\"));\nJadxDecompiler d = new JadxDecompiler(args);\nd.load();","handlingStrategy":"validation","validationCode":"// Validate args before initializing jadx.\nList<File> inputs = args.getInputFiles();\nif ((inputs == null || inputs.isEmpty()) && customLoaders.isEmpty()) {\n    throw new IllegalArgumentException(\"At least one input file or a custom code loader is required.\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    decompiler.load();\n} catch (JadxArgsValidateException e) {\n    if (e.getMessage().contains(\"specify input file\")) {\n        // fix args and retry\n        args.setInputFiles(List.of(apkFile));\n        decompiler.load();\n    } else throw e;\n}","preventionTips":["Always set args.setInputFiles(...) (or addCustomCodeLoader) before load().","Wrap a custom integration's args building with a sanity check that input files are non-empty.","Treat this as a programming error, not a runtime data error."],"tags":["validation","configuration","args","startup"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}