Home > front end >  Having issues in initial ANTLR4 setup on macOS Monterrey
Having issues in initial ANTLR4 setup on macOS Monterrey

Time:10-12

I am trying to setup ANTLR4 and I am having issues setting the classpath. I followed the instructions in the book "The Definitive ANTLR 4 Reference 2nd Edition", in section "Installing ANTLR", also I followed the instructions enter image description here

and in file zshrc I am loading configuration from bash_profile.

This is the output from my terminal.

Output in terminal

CodePudding user response:

Mac OS is gradually locking things down tighter and tighter on the system volume. While I think there's a good argument that /usr/local/ shouldn't be a part of that, it looks like it is.

Try placing your antler jar file some place within you home directory (perhaps changing all references to /usr/local to just be ~ (or maybe ~/local if you'd prefer to separate them out.)

I just downloaded the latest:

cd ~/lib
sudo curl -O https://www.antlr.org/download/antlr-4.11.1-complete.jar

changed by .zshrc to reference the new version:

export CLASSPATH=".:$HOME/lib/antlr-4.11.1-complete.jar:$CLASSPATH"
alias antlr4='java -jar $HOME/lib/antlr-4.11.1-complete.jar'
alias grun='java org.antlr.v4.gui.TestRig'

grun is running just fine

  • Related