Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Visit the download page and download the "Complete ANTLR x.y Java binaries jar" file.
    • For example, from a Linux shell, download ANTLR 3.3 to your home directory:
      No Format
      cd ~
      wget http://www.antlr.org/download/antlr-3.3-complete.jar
      
  2. Add ANTLR to your CLASSPATH environmental variable and run it:
    No Format
    export CLASSPATH=~/antlr-3.3-complete.jar:$CLASSPATH
    java org.antlr.Tool -version
    
    (tick) Expect output like the following:
    No Format
    ANTLR Parser Generator  Version 3.3 Nov 30, 2010 12:50:56
    
    (error) If you see output like the following, the CLASSPATH is not set up properly:
    No Format
    Exception in thread "main" java.lang.NoClassDefFoundError
    
    (error) If you see an older version of ANTLR, your CLASSPATH may not be set up properly and Java may be finding ANTLR in .jar files from bundled with an application like BEA WebLogic. Ensure the path to the current .jar of ANTLR is at the beginning of your CLASSPATH.
  3. Configure your CLASSPATH to include ANTLR on future logins.
    • For example, on a BASH shell, add the environmental variable to the .bashrc script:
      No Format
      echo "export CLASSPATH=~/antlr-3.3-complete.jar:$CLASSPATH" >> ~/.bashrc