How can i add ANTLR to classpath

I installed ANTLR via brew. Official tutorial says that I should do the following:

Add ANTLR to your

CLASSPATH
environmental variable and run it:

export CLASSPATH=~/antlr-3.3-complete.jar:$CLASSPATH java org.antlr.Tool -version

However it is not working. I'm waiting for your replies,

Mehmet

(PS. I bought my Mac 1 month ago. Prior to that, I had no knowledge on OS X whatsoever. So I'm n00b, please answer accordingly)


The "add to your classpath" and "run it" are separate commands; the first being

export CLASSPATH=~/antlr-3.3-complete.jar:$CLASSPATH

and the second

java org.antlr.Tool -version


Of course the path in the first command should be the actual path to the jar file. If you put it somewhere else then you would use that. e.g. if in a "lib" directory in your home directory you could use ${HOME}/lib/antlr-3.3-complete.jar.


Disclaimer - I have no experience with that particular product.

export CLASSPATH=/your/stuff/


or preserving system wide settings:


export CLASSPATH=$CLASSPATH:/your/addition/


the only different from Windows in terms of path-separators, : instead of ;


For example


java -classpath /mydir/mylib.jar:/otherdir/otherlib.jar com.MyProgram -Xmx64m


wildcard in the classpath to add multiple jars


java -cp "Halo.jar:lib/" ni.package.MainClass


More about....Java Classpath


Anto

How can i add ANTLR to classpath
 
 
Q