Getting Started

Most people who use the legacy JavaCC/JJTree tools should be able to switch over to JavaCC 21 with little fuss. The gotchas that one would run into involve where the default settings have changed. (Or even disappeared. For example, JavaCC 21 does not support "static", i.e. non-thread-safe parsers.) JavaCC 21, by default, builds an AST, and you would need to explicitly turn this off to replicate the behavior of the legacy JavaCC tool.

Getting started as a user.

JavaCC 21 is based on the idea that things should just work. (What a concept, dude!) Here is the instant gratification download link:

javacc-full.jar

There are no other dependencies and you should be able to run it via:

java -jar javacc-full.jar

The above command-line should work on PC, Mac, or Linux. That's all, folks! (Look, ma! No hands!) (N.B. Only Java 8 or higher is supported.)

(N.B. For those who are interested in FreeMarker, the above-linked javacc-full.jar is also a freemarker jarfile! It contains all the latest FreeMarker classes and can, generally speaking, be used as a drop-in substitute for a freemarker.jar file. However, it is not the exact same version as Apache Freemarker, which was further work on the obsolete 2.3.x codebase, but rather the latest 2.4.x codebase that was abandoned to rot on Sourceforge, but will soon be resuscitated.)

Hacking the code

If you are one of the minority (probably quite small) that actually wants to hack the JavaCC source code, then:

git clone https://github.com/javacc21/javacc21.git
cd javacc21
ant

To build the parser classes (without compiling) from the command-line, you have the parser-gen ant task, i.e.

ant parser-gen

or alternatively (if, by some chance, you don't have ant):

bin/buildparser

In general, you should be able to open the root directory directly as a project in either Eclipse or IntelliJ and this will be the path of least resistance.

Getting Help

We are very interested in any bug reports, suggestions or other feedback. Currently, the preferred way to bring up any issue is to sign up on the Discourse forum. That way, any discussion will be publicly visible. If you are too shy to post on the forum or have some other reason, you can also write email here.

Note that all technical support is based on your using the latest version of the code! We do not provide technical support for last year's code, nor last month's code, or even last week's -- if there is a newer version than that. If you want to know what version your downloaded jarfile is, use this command:

jar tfv javacc-full.jar

The date you see there on the various .class files is effectively the version of the code you are using. If it is more than a few days old, get the latest one. Again, there is no technical support on anything but the latest version.

In general, the way to be absolutely sure you are using the latest version would be to do the git checkout and build described above. That said, we intend to keep the download links above current and simply using that should be good enough.