I want to test my programme, so I have downloaded JavaCC 5.0, as 6.0 has issues. I have copied /bin to usr/local/bin but now when I input javacc MyTest.jj into terminal I get the following error.
Error: Could not find or load main class javacc
I've looked around to see why this error occurs, and the only thing I have found relating to this is this question
Could not load main class in JavaCC
As I am using an older version of JavaCC, there should be no issue with the PATH.
Also, while trying to find a cause for this error, I have found that it only seems to occur if the input in terminal is java class so why is it happening?
What can I do to get Javacc working?
Asked
Active
Viewed 1,459 times
2
Community
- 1
- 1
GreenClover
- 23
- 5
1 Answers
3
Your file structure should look like this where .../bin is some directory on your unix path
.../bin/
javacc
jjrun
jjtree
lib/
javacc.jar
Of course the three jj* files should be executable.
In a terminal enter which javacc. Presumably the answer will be /usr/local/bin. Look for a directory called /usr/local/bin/lib. If it's not there, create it. It should contain a file named javacc.jar. If not, find the javacc.jar file you downloaded and place it in this directory.
Theodore Norvell
- 15,366
- 6
- 31
- 45