antlr/antlr4 · error
ANTLR installation corrupted; ANTLR messages format file +
Error message
ANTLR installation corrupted; ANTLR messages format file + formatName + .stg incomplete
What it means
Error "ANTLR installation corrupted; ANTLR messages format file + formatName + .stg incomplete" thrown in antlr/antlr4.
Source
Thrown at tool/src/org/antlr/v4/tool/ErrorManager.java:258
loadedFormat = new STGroupFile(url, "UTF-8", '<', '>');
loadedFormat.load();
loadedFormats.put(formatName, loadedFormat);
}
}
this.formatName = formatName;
this.format = loadedFormat;
if (!initSTListener.errors.isEmpty()) {
rawError("ANTLR installation corrupted; can't load messages format file:\n" +
initSTListener.toString());
panic();
}
boolean formatOK = verifyFormat();
if (!formatOK && formatName.equals("antlr")) {
rawError("ANTLR installation corrupted; ANTLR messages format file " + formatName + ".stg incomplete");
panic();
}
else if (!formatOK) {
setFormat("antlr"); // recurse on this rule, trying the default message format
}
}
/** Verify the message format template group */
protected boolean verifyFormat() {
boolean ok = true;
if (!format.isDefined("location")) {
System.err.println("Format template 'location' not found in " + formatName);
ok = false;
}
if (!format.isDefined("message")) {
System.err.println("Format template 'message' not found in " + formatName);
ok = false;
}View on GitHub (pinned to 7d5770395b)
Solutions
- Reinstall the ANTLR tool; the named messages format .stg file is incomplete or truncated.
- Restore the original .stg files from the ANTLR distribution matching your tool version.
- If the file was edited locally, revert it to the released version.
Example fix
// re-download the antlr-4.x-complete.jar for your version and replace the corrupted one
When it happens
Trigger: The loaded messages format .stg file is missing required templates (incomplete).
Common situations: Reinstall ANTLR; ensure the complete messages .stg ships inside the tool jar.
AI-assisted analysis of antlr/antlr4@7d5770395b (2026-08-14).
Data as JSON: /api/errors/25acbe355fea9e4e.
Report an issue: GitHub.