[antlr-interest] problem with classpath under winxp

jbb at acm.org jbb at acm.org
Wed Jul 30 07:19:37 PDT 2003


Patrik :-

First, please note that I am not currently typing on my WinXP machine,
so this is from memory. But I believe the following to be correct...

>1) When I set the environment variable as follows:
>
>	CLASSPATH=c:\antlr-2.7.2\antlr.jar
>
>I'm able to run antlr generator, but I can't run any Java program.
>For example the simple program that print hello world fail, with
>
>-> Exception in thread "main" java.lang.NoClassDefFoundError: Test

use

	CLASSPATH=%CLASSPATH%;c:\antlr-2.7.2\antlr.jar

the %CLASSPATH% portion inserts whatever the current value of the CLASSPATH
variable is in front of the antlr path so that all other classes will be
found before antlr.

>3) Ok ! i've generated antlr's output files, now I will compile ..
>but when compile javac needs either java CLASSPATH variable, 
>either antlr CLASSPATH variable.

use

javac -classpath %CLASSPATH%;c:\antlr-2.7.2\antlr.jar antlr.Tool file.g

(note: maybe the "%CLASSPATH%;" part isn't required here...)

also see the output of

javac

(just compile no options no files) to observe that the compiler doesn't
accept -cp but rather wants -classpath

hope this helps...

	-jbb

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list