Packages of ANTLR available from the repositories of distributions like Ubuntu are quite old and probably worth avoiding. |
You can skip this step if you know Java is properly installed. |
sudo apt-get install default-jdk |
java -version |
java version "1.6.0_20" OpenJDK Runtime Environment (IcedTea6 1.9.5) (6b20-1.9.5-0ubuntu1~10.04.1) OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode) |
cd ~ wget http://www.antlr.org/download/antlr-3.3-complete.jar |
CLASSPATH
environmental variable and run it:
export CLASSPATH=~/antlr-3.3-complete.jar:$CLASSPATH java org.antlr.Tool -version |
ANTLR Parser Generator Version 3.3 Nov 30, 2010 12:50:56 |
CLASSPATH
is not set up properly:
Exception in thread "main" java.lang.NoClassDefFoundError |
CLASSPATH
may not be set up properly and Java may be finding ANTLR in .jar
files bundled with an application like BEA WebLogic. Ensure the path to the current .jar
of ANTLR is at the beginning of your CLASSPATH
.CLASSPATH
to include ANTLR on future logins.
BASH
shell, add the environmental variable to the .bashrc
script:
echo "export CLASSPATH=~/antlr-3.3-complete.jar:$CLASSPATH" >> ~/.bashrc |