Konloch/bytecode-viewer · error · Exception
Cannot find Groovy script engine! Please contact Konloch.
Error message
Cannot find Groovy script engine! Please contact Konloch.
What it means
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.
Source
Thrown at src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/GroovyPluginLaunchStrategy.java:45
import java.io.FileReader;
import java.io.Reader;
/**
* @author Konloch
* @author Bibl (don't ban me pls)
* @since 1 Jun 2015
*/
public class GroovyPluginLaunchStrategy implements PluginLaunchStrategy
{
@Override
public Plugin run(File file) throws Throwable
{
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("groovy");
if (engine == null)
throw new Exception("Cannot find Groovy script engine! Please contact Konloch.");
Reader reader = new FileReader(file);
engine.eval(reader);
return (Plugin) engine.eval("new " + file.getName().replace(".gy", "").replace(".groovy", "") + "();");
}
}
View on GitHub (pinned to 31430e0033)
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.
Example fix
// build.gradle: ensure dependency present
// before
dependencies { } // groovy missing -> engine == null -> throws
// after
dependencies { implementation 'org.codehaus.groovy:groovy:3.0.21' } Defensive patterns
Strategy: fallback
Try / catch
try {
PluginManager.runPlugin(groovyFile);
} catch (Throwable t) {
if (t.getMessage() != null && t.getMessage().contains("Cannot find Groovy script engine"))
showError("Groovy support unavailable in this build; use a compiled Java plugin or reinstall the full jar.");
else
throw t;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Multiple plugin subclasses.
- Invalid internal class name
- No launch strategy for extension %s (%s)
- Cannot find Javascript script engine! Please contact Konloch
- Cannot find Jython script engine! Please contact Konloch.
AI-assisted analysis of Konloch/bytecode-viewer@31430e0033 (2026-09-05).
Data as JSON: /api/errors/d91519d8c14d43b2.
Report an issue: GitHub.