On Sun, Dec 14, 2008 at 3:45 PM, Albert Cardona <sapri...@gmail.com> wrote: > > Mark Volkmann wrote: >> I'm trying AOT compilation for the first time. Here's what I did. >> >> - created the directory com/ociweb below my current directory >> - created the source file math.clj with the following content >> >> (ns com.ociweb.math) >> (defn fib [n] (reduce * (range 2 (inc n)))) >> >> - started a REPL in the current directory >> - entered (load "com/ociweb/math") >> - entered (com.ociweb.math/fib 5) to verify that it works >> - tried to compile it with (compile 'com.ociweb.math), but got >> java.lang.RuntimeException: java.lang.ClassNotFoundException: >> com.ociweb.math$fib__193 (NO_SOURCE_FILE:0) >> >> I have . in my classpath. Any idea what I'm doing wrong? >> > > > Your classpath does not contain the folder to the .clj file. > > See this example, with detailed explanations on classpath for compiling > and then running gen-class generated classes: > > http://pacific.mpi-cbg.de/wiki/index.php/Clojure_Scripting#Generating_java_classes_in_.class_files_from_clojure_code
Wow, that's a lot of things that have to be in the classpath! In your example the namespace is fj.tests.process. You say the classpath must contain: 1) the "fj" directory 2) the "process" directory 3) the "classes" directory where the .class files will be written I would have guessed I'd only need the directory that contains the fj directory in the classpath and that it would find the fj and process directories from there. I understand why I'd need the classes directory in the classpath when I'm ready to use the .class file, but why do I need it when I'm only compiling the .clj source file? -- R. Mark Volkmann Object Computing, Inc. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---