[antlr-interest] ClassNotFound exception when run gUnit

Duy Tho Nguyen tho at catglobe.com
Thu Apr 1 03:10:43 PDT 2010


I'm on my way to set up gUnit for my grammar. I'm learning the tutorial 
found there :
http://www.antlr.org/wiki/display/ANTLR3/gUnit+-+Grammar+Unit+Testing

I follow all the instruction but  when run gUnit, it give an error like 
this :

C:\__GUnit\examples\java\LL-star>java org.antlr.Tool SimpleC.g

C:\__GUnit\examples\java\LL-star>javac *.java

C:\__GUnit\examples\java\LL-star>java org.antlr.gunit.Interp SimpleC.gunit
java.lang.ClassNotFoundException: SimpleCLexer
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at org.antlr.gunit.gUnitExecutor.classForName(gUnitExecutor.java:98)
        at org.antlr.gunit.gUnitExecutor.runParser(gUnitExecutor.java:308)
        at 
org.antlr.gunit.gUnitExecutor.runCorrectParser(gUnitExecutor.java:159)
        at 
org.antlr.gunit.gUnitExecutor.executeTests(gUnitExecutor.java:175)
        at org.antlr.gunit.gUnitExecutor.execTest(gUnitExecutor.java:123)
        at org.antlr.gunit.Interp.main(Interp.java:71)

Java code for lexer and parser are generated and compile successfully 
and all files are located in the same folder:
c:\__GUnit\examples\java\LL-star\input
c:\__GUnit\examples\java\LL-star\SimpleC.g
c:\__GUnit\examples\java\LL-star\SimpleC.gunit
c:\__GUnit\examples\java\LL-star\SimpleC.tokens
c:\__GUnit\examples\java\LL-star\SimpleCLexer$DFA4.class
c:\__GUnit\examples\java\LL-star\SimpleCLexer.class
c:\__GUnit\examples\java\LL-star\SimpleCLexer.java
c:\__GUnit\examples\java\LL-star\SimpleCParser$DFA2.class
c:\__GUnit\examples\java\LL-star\SimpleCParser.class
c:\__GUnit\examples\java\LL-star\SimpleCParser.java

I can't figure out what is wrong to cause ClassNotFound exception so 
would someone please help me fix it.
I'm on a WinXP 64, using antlr 3.1.3,  string template  3.2  and   
jdk1.6.0_11.

Thank in advance




More information about the antlr-interest mailing list