Compiling Regular Expressions | ClassCastException

Charles Turner chturne@gmail.com
Thu Nov 7 23:48:00 GMT 2013


Hi,

On the tutorial page for compiling regular expressions:

http://www.gnu.org/software/kawa/gnu.bytecode/compiling-regexps.html

I'm getting a ClassCastException when I try to run the copied & pasted
code from the above webpage. Specifically:

$ echo $CLASSPATH
.:/home/charles/src/kawa-fresh/kawa-1.14.1.jar
$ ls
CompileRegexp.java  Pattern.java
$ javac CompileRegexp.java
Note: CompileRegexp.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
$ javac -version
javac 1.7.0_25
$ java CompileRegexp "a*b" "aooooob"
Exception in thread "main" java.lang.ClassCastException:
gnu.bytecode.ClassType cannot be cast to java.lang.Class
at gnu.bytecode.ArrayClassLoader.loadClass(ArrayClassLoader.java:138)
at gnu.bytecode.ArrayClassLoader.loadClass(ArrayClassLoader.java:98)
at CompileRegexp.main(CompileRegexp.java:132)

I'm struggling to understand why that's happening in the
ArrayClassLoader. Any thoughts? Is this bug? I tried running against
Kawa version 1.12 for kicks, but the same result.

Regards,
Charles.



More information about the Kawa mailing list