Setting javacc to work with command prompt

In the version 6.0 the bin directory is missing the scripts which run javacc. That is why you are getting the error from the windows command prompt.

What you have is a jar file javacc.jar located in the lib directory. All you need is to add that jar file to your classpath and run the java.exe and pass the main class which runs javacc, the later happens to be named javacc too, so to run javacc just proceed like this:

cmd>  java -cp C:\javacc-6.0\bin\lib\javacc.jar javacc

In the latest version they seem to have forgotten to add the scripts in the bin folder of the package. You can download version 5.0, it containes all the script files you need, among others a file with the name javacc.bat, this is the one the window commad prompt is looking for and not finding in your case.

Of course, you can just copy those scripts from the 5.0 version to the bin directory of the 6.0 version, they will also work. and since you already have set the path to contain C:\javacc-6.0\bin then you can run it like you have tried before, without closing the command prompt window or even restarting your whole computer!

Edit - new links

The links above are unfortunately no longer valid, luckily the content has been moved to github. here the new links:

Project url: https://javacc.org/

Project url on github: https://javacc.github.io/javacc/

Earlier versions: https://github.com/javacc/javacc/branches/

Tags:

Java

Path

Javacc