{"record":{"id":"00b5412cfcd6a770","repo":"antlr/antlr4","slug":"antlr-installation-corrupted-can-t-load-messages","errorCode":null,"errorMessage":"ANTLR installation corrupted; can't load messages format file:\\n + initSTListener.toString()","messagePattern":"ANTLR installation corrupted; can't load messages format file:\\\\n \\+ initSTListener\\.toString\\(\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tool/src/org/antlr/v4/tool/ErrorManager.java","lineNumber":251,"sourceCode":"\t\t\t\t\tpanic();\n\t\t\t\t}\n\t\t\t\telse if (url == null) {\n\t\t\t\t\trawError(\"no such message format file \" + fileName + \" retrying with default ANTLR format\");\n\t\t\t\t\tsetFormat(\"antlr\"); // recurse on this rule, trying the default message format\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tloadedFormat = new STGroupFile(url, \"UTF-8\", '<', '>');\n\t\t\t\tloadedFormat.load();\n\n\t\t\t\tloadedFormats.put(formatName, loadedFormat);\n\t\t\t}\n\t\t}\n\n\t\tthis.formatName = formatName;\n\t\tthis.format = loadedFormat;\n\n\t\tif (!initSTListener.errors.isEmpty()) {\n\t\t\trawError(\"ANTLR installation corrupted; can't load messages format file:\\n\" +\n\t\t\t\t\tinitSTListener.toString());\n\t\t\tpanic();\n\t\t}\n\n\t\tboolean formatOK = verifyFormat();\n\t\tif (!formatOK && formatName.equals(\"antlr\")) {\n\t\t\trawError(\"ANTLR installation corrupted; ANTLR messages format file \" + formatName + \".stg incomplete\");\n\t\t\tpanic();\n\t\t}\n\t\telse if (!formatOK) {\n\t\t\tsetFormat(\"antlr\"); // recurse on this rule, trying the default message format\n\t\t}\n\t}\n\n    /** Verify the message format template group */\n    protected boolean verifyFormat() {\n        boolean ok = true;\n        if (!format.isDefined(\"location\")) {","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/antlr/antlr4/blob/7d5770395bb7b02eb56e7c62662cb1d7c08f42a3/tool/src/org/antlr/v4/tool/ErrorManager.java#L233-L269","documentation":"Error \"ANTLR installation corrupted; can't load messages format file:\\n + initSTListener.toString()\" thrown in antlr/antlr4.","triggerScenarios":"ErrorManager cannot load the ANTLR messages format (.stg) file from the jar/resources at startup.","commonSituations":"Reinstall ANTLR; the tool jar is corrupted or missing org/antlr/v4/tool/templates messages .stg resources.","solutions":["Reinstall or rebuild the ANTLR tool; the messages format resource file failed to load (see the listener output appended to the message).","Ensure antlr4 STG resource files (org/antlr/v4/tool/templates/...) are on the classpath and not corrupted or filtered by the build.","If shaded/relocated by a build plugin, include the .stg resources in the shaded jar."],"exampleFix":"// rebuild with resources included: mvn -q -DskipTests package\n// and verify jar contains org/antlr/v4/tool/templates/messages/formats/*.stg","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d5770395bb7b02eb56e7c62662cb1d7c08f42a3","analyzedAt":"2026-08-14T14:47:56.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}