其他分享
首页 > 其他分享> > Antlr安装 antlr4.bat和grun.bat不起作用解决

Antlr安装 antlr4.bat和grun.bat不起作用解决

作者:互联网

  1. Download antlr-4.9-complete.jar (or whatever version) from https://www.antlr.org/download/ Save to your directory for 3rd party Java libraries, say C:\Javalib
  2. Add antlr-4.9-complete.jar to CLASSPATH, either:
SET CLASSPATH=.;C:\Javalib\antlr-4.9-complete.jar;%CLASSPATH%
  1. Create short convenient commands for the ANTLR Tool, and TestRig, using batch files or doskey commands:
java org.antlr.v4.Tool %*
@ECHO OFF
SET TEST_CURRENT_DIR=%CLASSPATH:.;=%
if "%TEST_CURRENT_DIR%" == "%CLASSPATH%" ( SET CLASSPATH=.;%CLASSPATH% )
@ECHO ON
java org.antlr.v4.gui.TestRig %*
doskey antlr4=java org.antlr.v4.Tool $*
doskey grun =java org.antlr.v4.gui.TestRig $*

Testing the installation

Either launch org.antlr.v4.Tool directly:

$ java org.antlr.v4.Tool
ANTLR Parser Generator Version 4.9
-o ___ specify output directory where all output is generated
-lib ___ specify location of .tokens files
...

or use -jar option on java:

$ java -jar /usr/local/lib/antlr-4.9-complete.jar
ANTLR Parser Generator Version 4.9
-o ___ specify output directory where all output is generated
-lib ___ specify location of .tokens files
...

标签:bat,java,Antlr,4.9,grun,jar,antlr,v4,org
来源: https://blog.csdn.net/qr457535344/article/details/119420129