1.下载
lcc@lcc hellow$ cd /usr/local/lib/
lcc@lcc hellow$ curl -O http://www.antlr.org/download/antlr-4.0-complete.jar
可以看到该目录下出现一个jar包
-rw-r--r-- 1 lcc staff 0 6 29 16:18 antlr-4.0-complete.jar
2.修改环境变量
lcc@lcc ~$ vim .bash_profile
export CLASSPATH=".:/usr/local/lib/antlr-4.0-complete.jar:$CLASSPATH"
alias antlr4='java -jar /usr/local/lib/antlr-4.0-complete.jar'
alias grun='java org.antlr.v4.runtime.misc.TestRig'
lcc@lcc ~$ source .bash_profile