January 26, 2013 by Chris Johnson. Filed under cs330, specifications, spring 2013.
See the PDF.
I’ve been using Eclipse to compile and test my code as I go, which works great. However, when I try to run it on the thingies, I get a ClassCastException error:
Exception in thread “main” java.lang.ClassCastException: class Interpreter
I’ve commented out everything in my main method so I only have the class declaration extending JSONographBaseListener and the main method throwing an IOException. All I could find on the web on this subject were a few scatterings about duplicate classes (which I don’t believe I have) or issues with the grammar (needing carots in some regex areas?).
If you experience this on the thingies but not in Eclipse, I’m guessing the problem is in your configuration. In Eclipse, you added the JAR to your build path. Did you do the equivalent thing on the thingies?
The equivalent thing is to include the JAR file in the Java build path. This can be done per command-line:
$ javac -cp ~/w330/jsonograph/antlr-4.0-complete.jar:. MyClass.java
Or once, in an environment variable in .bashrc or .zshrc:
My misunderstanding; I was using grun to test it in Linux after compiling. It runs the same as Eclipse using java instead of grun.
In the 7th specification, should fragment HEX be a..z or a..f?
It depends on whether you want to be right or to follow the specification.
Your email address will not be published. Required fields are marked *
Notify me of follow-up comments by email.
Notify me of new posts by email.