I'm new to Linux but i'm doing a tutorial for Antlr4. Recently, I've come into a problem. When I try to set up my Antlr4 project, I run the following commands in a terminal:
antlr4 MyGram.g4
javac *.java
grun MyGram prog test.in
dot -Tpdf test.dot > test.pdf
Everything runs fine and it creates a pdf file showing the parse tree. However, when I put these commands into a bash script called build.sh:
#!/bin/bash
antlr4 MyGram.g4
javac *.java
grun MyGram prog test.in
dot -Tpdf test.dot > test.pdf
and then run the command: ./build.sh and I get the following errors and no pdf file is created:
./build.sh: line 3: antlr4: command not found
javac: file not found: *.java
Usage: javac <options> <source files>
use -help for a list of possible options
./build.sh: line 5: grun: command not found
Error: dot: can't open test.dot
Can anyone please explain the reason why I'm getting these errors ? I'm running Ubuntu 18.04 on VMware Workstation 14 Player.