{"record":{"id":"d91519d8c14d43b2","repo":"Konloch/bytecode-viewer","slug":"cannot-find-groovy-script-engine-please-contact-k","errorCode":null,"errorMessage":"Cannot find Groovy script engine! Please contact Konloch.","messagePattern":"Cannot find Groovy script engine! Please contact Konloch\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/GroovyPluginLaunchStrategy.java","lineNumber":45,"sourceCode":"import java.io.FileReader;\nimport java.io.Reader;\n\n/**\n * @author Konloch\n * @author Bibl (don't ban me pls)\n * @since 1 Jun 2015\n */\npublic class GroovyPluginLaunchStrategy implements PluginLaunchStrategy\n{\n\n    @Override\n    public Plugin run(File file) throws Throwable\n    {\n        ScriptEngineManager manager = new ScriptEngineManager();\n        ScriptEngine engine = manager.getEngineByName(\"groovy\");\n\n        if (engine == null)\n            throw new Exception(\"Cannot find Groovy script engine! Please contact Konloch.\");\n\n        Reader reader = new FileReader(file);\n        engine.eval(reader);\n\n        return (Plugin) engine.eval(\"new \" + file.getName().replace(\".gy\", \"\").replace(\".groovy\", \"\") + \"();\");\n    }\n}\n","sourceCodeStart":27,"sourceCodeEnd":53,"githubUrl":"https://github.com/Konloch/bytecode-viewer/blob/31430e0033fa220db566b5ef461256727ff6793b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/GroovyPluginLaunchStrategy.java#L27-L53","documentation":"GroovyPluginLaunchStrategy.run obtains a Groovy ScriptEngine via ScriptEngineManager.getEngineByName(\"groovy\"). If no Groovy engine is registered (the Groovy scripting dependency is absent from the classpath) it throws Exception telling the user to contact Konloch. Running Groovy plugins requires the embedded Groovy engine at runtime.","triggerScenarios":"Running a .gy/.groovy plugin when ScriptEngineManager cannot find a 'groovy' engine — i.e. the Groovy dependency is not on the classpath or the ScriptEngineManager classloader cannot see it.","commonSituations":"Custom/partial builds of Bytecode Viewer that excluded the Groovy dependency; running with a stripped or repackaged jar; Groovy version conflicts (javax.script provider missing from META-INF/services); executing only the plugin module standalone.","solutions":["Rebuild or re-download Bytecode Viewer with the Groovy dependency included (full release jar).","Add org.codehaus.groovy:groovy (with its JSR-223 ScriptEngineFactory service registration) to the classpath.","Check META-INF/services/javax.script.ScriptEngineFactory is present and not filtered by shading/minimization.","As a workaround, use a compiled Java plugin instead of a Groovy script.","If the engine exists but still fails, report to Konloch as the message suggests."],"exampleFix":"// build.gradle: ensure dependency present\n// before\ndependencies { } // groovy missing -> engine == null -> throws\n// after\ndependencies { implementation 'org.codehaus.groovy:groovy:3.0.21' }","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    PluginManager.runPlugin(groovyFile);\n} catch (Throwable t) {\n    if (t.getMessage() != null && t.getMessage().contains(\"Cannot find Groovy script engine\"))\n        showError(\"Groovy support unavailable in this build; use a compiled Java plugin or reinstall the full jar.\");\n    else\n        throw t;\n}","preventionTips":["Use the full Bytecode Viewer release jar that bundles the Groovy dependency.","Verify 'groovy' resolves via ScriptEngineManager before offering Groovy plugin support.","Do not strip META-INF/services/javax.script.ScriptEngineFactory when shading.","Prefer compiled Java plugins in minimal builds without Groovy."],"tags":["plugin-system","groovy","script-engine","missing-dependency","classpath"],"backgroundTag":"script-engine-not-found","analyzedSha":"31430e0033fa220db566b5ef461256727ff6793b","analyzedAt":"2026-09-05T18:22:22.725Z","contentChangedAt":"2026-09-05T18:22:22.725Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}