You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to help newbies get started more quickly by spelling out the ANTLR dependencies everywhere? For example, the Using StringTemplate with Java page does say
All you need to do is get the StringTemplate jar into your CLASSPATH as well as its dependent ANTLR jar.
which is good, but better would be to help newcomers understand what exactly "its dependent ANTLR jar" is (e.g., its Maven coordinates, or at least the version). Moreover, the download page says
To use maven, refer to group ID org.antlr and artifact ID ST4 in your pom.xml file:
but makes no mention of an ANTLR dependency. So far I haven't found anything that says which ANTLR version to use for which ST4 version. Through trial-and-error, ANTLR 3.5.3 seemed to work with ST4 4.3.4. Surprisingly, none of the ANTLR4 versions I tried seemed to work. All threw ClassNotFoundException: org.antlr.runtime.Token. I'll keep looking. Maybe it's spelled out somewhere.
@dventimihasura You seem to be correct. I had this same problem when trying to use StringTemplate4 in a Scala project recently. I tried using ST-4.3.4.jar along with antlr-runtime-4.13.2.jar, which did not work. The error was the same as yours: it could not find the org.antlr.runtime.Token class. The stringtemplate4 java.md on GitHub is poorly worded and lacking in details. I replaced antlr-runtime-4.13.2.jar with ST-3.5.3-complete.jar and was able to get it working.
Activity
codegorilla commentedon Jul 10, 2025
@dventimihasura You seem to be correct. I had this same problem when trying to use StringTemplate4 in a Scala project recently. I tried using ST-4.3.4.jar along with antlr-runtime-4.13.2.jar, which did not work. The error was the same as yours: it could not find the org.antlr.runtime.Token class. The stringtemplate4
java.mdon GitHub is poorly worded and lacking in details. I replaced antlr-runtime-4.13.2.jar with ST-3.5.3-complete.jar and was able to get it working.