{"record":{"id":"8643f147e6dd39b0","repo":"Konloch/bytecode-viewer","slug":"no-launch-strategy-for-extension-s-s","errorCode":null,"errorMessage":"No launch strategy for extension %s (%s)","messagePattern":"No launch strategy for extension (.+?) \\((.+?)\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginManager.java","lineNumber":130,"sourceCode":"        PLUGIN_INSTANCES.add(newPluginInstance);\n\n        //start the plugin thread\n        newPluginInstance.start();\n    }\n\n    /**\n     * Starts and runs a plugin from file\n     *\n     * @param f the file of the plugin\n     * @throws Exception\n     */\n    public static void runPlugin(File f) throws Throwable\n    {\n        String ext = f.getName().substring(f.getName().lastIndexOf('.') + 1);\n        PluginLaunchStrategy strategy = LAUNCH_STRATEGIES.get(ext);\n\n        if (strategy == null)\n            throw new RuntimeException(String.format(\"No launch strategy for extension %s (%s)\",\n                ext, f.getAbsolutePath()));\n\n        Plugin p = strategy.run(f);\n\n        if (p != null)\n            runPlugin(p);\n    }\n\n    /**\n     * Add an active console from a plugin being ran\n     */\n    public static void addExceptionUI(ExceptionUI ui)\n    {\n        if (activePlugin == null)\n        {\n            ui.setLocationRelativeTo(BytecodeViewer.viewer);\n            ui.setVisible(true);\n            return;","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/Konloch/bytecode-viewer/blob/31430e0033fa220db566b5ef461256727ff6793b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginManager.java#L112-L148","documentation":"PluginManager.runPlugin(File) looks up a PluginLaunchStrategy keyed by the file's extension in LAUNCH_STRATEGIES (e.g. for compiled Java/Groovy plugins). If no strategy is registered for the extension it throws RuntimeException with the extension and full path. Only known plugin formats can be launched from the plugin system.","triggerScenarios":"Calling PluginManager.runPlugin(File) (or using the plugin launcher UI) with a file whose extension has no registered launch strategy — e.g. .jar without a strategy variant, .txt, .py, or a renamed plugin.","commonSituations":"Selecting a random file via 'run plugin'; a plugin packaged in an unsupported format; typos or renamed extensions (.GY vs .gy handled differently elsewhere); using a plugin format from a different Bytecode Viewer version.","solutions":["Use a supported plugin format: .java compiled with the matching strategy (CompiledJavaPluginLaunchStrategy) or a Groovy script (.gy/.groovy).","Check the file extension and rename it to the correct supported one if it was misnamed.","Extend LAUNCH_STRATEGIES in PluginManager to register a custom PluginLaunchStrategy for your format.","Compile your plugin per the Bytecode Viewer plugin documentation before running it."],"exampleFix":"// before\nPluginManager.runPlugin(new File(\"myplugin.py\")); // throws: no strategy for py\n// after\nPluginManager.runPlugin(new File(\"MyPlugin.groovy\")); // supported strategy exists","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    PluginManager.runPlugin(pluginFile);\n} catch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"No launch strategy\"))\n        showError(\"Unsupported plugin format. Use a compiled Java or Groovy (.gy/.groovy) plugin.\");\n    else\n        throw e;\n}","preventionTips":["Only pass files with extensions registered in PluginManager.LAUNCH_STRATEGIES.","Compile plugins to a supported format before running.","Never rename plugin files to arbitrary extensions.","Register a custom PluginLaunchStrategy when adding a new format."],"tags":["plugin-system","unsupported-format","runtime-exception"],"backgroundTag":"unsupported-file-format","analyzedSha":"31430e0033fa220db566b5ef461256727ff6793b","analyzedAt":"2026-09-05T18:22:22.725Z","contentChangedAt":"2026-09-05T18:22:22.725Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}