meta data for this page
  •  

This is an old revision of the document!


If all you want to do is use the tool, all you need to do is download the following two files:

https://javacc.com/download/javacc.jar https://javacc.com/download/freemarker.jar

Put both files in the same directory somewhere and then the tool should be runnable via:

 java -jar <wherever-you-downloaded-thefiles>/javacc.jar <MyGrammar.javacc>

That’s all, folks! The freemarker.jar must be in the same directory as the javacc.jar. Aside from that, there are no other dependencies. The above command-line should work on PC, Mac, or Linux.

The rest of the page is for the small minority of people who want to hack the code. The most basic requirements are:

  • JDK (1.8 or higher)
  • Git
  • Apache Ant

You should be able to check out and build the code like so:

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

There is a test suite of sorts that you can run with:

  ant test    

If the above is all successful, in principle, you are able to hack the code. None of this should require any tinkering with any environment variables such as CLASSPATH.

Now, of course, most people will want to get the code into an IDE, such as Eclipse or IntelliJ. I tried my best to have the project set up to work with either of those IDE's out of the box. I described that here

You may run into some issue (in particular with Eclipse) in terms of defining the Project properties so it uses the appropriate JDK.