Re: Compilation and Class Generation newbie questions
Hello If you declared clojure.examples.hello namespace, then you need to have file hello.clj in clojure/examples/ directory. and you need to have c:\clojure_tests in classpath, something like: java -cp clojure.jar:c:\clojure_tests clojure.main Paulo Sérgio Medeiros at "Mon, 15 Feb 2010 03:13:51 -0200" wrote: PSM> Hello everyone, PSM> I think i've not figured out yet how compile and/or namespace works. PSM> I'm trying to execute the example posted in http://clojure.org/compilation PSM> I've created a file named "hello.clj" and put the clojure.jar in the same directory (c:\clojure_tests). PSM> Then, i started the REPL using the command: java -cp clojure.jar clojure.main PSM> And executed (compile 'clojure.examples.hello), but i'm getting the following error: PSM> java.io.FileNotFoundException: Could not locate clojure/examples/hello__init.class or clojure/examples/hello.clj on classpath: PSM> (NO_SOURCE_FILE:0) PSM> If i execute compile with a different namespace like (compile 'hello) then i get the following error: PSM> java.io.IOException: The system cannot find the path specified (hello.clj:1) PSM> Is there any relationship between the namespace name and the file name? How compile determines which file is going to be compiled? PSM> Thanks in advance, PSM> Paulo Sergio. -- With best wishes, Alex Ott, MBA http://alexott.blogspot.com/ http://alexott.net http://alexott-ru.blogspot.com/ -- 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 Note that posts from new members are moderated - please be patient with your first post. 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
Re: Compilation and Class Generation newbie questions
Hi, On Feb 15, 6:13 am, Paulo Sérgio Medeiros wrote: > I think i've not figured out yet how compile and/or namespace works. > > I'm trying to execute the example posted inhttp://clojure.org/compilation > > I've created a file named "hello.clj" and put the clojure.jar in the same > directory (c:\clojure_tests). > > Then, i started the REPL using the command: java -cp clojure.jar > clojure.main > > And executed (compile 'clojure.examples.hello), but i'm getting the > following error: > > java.io.FileNotFoundException: Could not locate > clojure/examples/hello__init.class or clojure/examples/hello.clj on > classpath: (NO_SOURCE_FILE:0) > > If i execute compile with a different namespace like (compile 'hello) then i > get the following error: > > java.io.IOException: The system cannot find the path specified (hello.clj:1) > > Is there any relationship between the namespace name and the file name? How > compile determines which file is going to be compiled? >From http://clojure.org/compilation: For some namespace my.domain.lib, defined in my/domain/lib.clj, in the classpath, ... So put your file in src/clojure/examples/hello.clj. Create also a directory called classes. Then invoke clojure with java -cp src;classes;clojure.jar clojure.main -r and compile the namespace as you did before. The compiled classes will end up in the classes directory. Sincerely Meikel -- 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 Note that posts from new members are moderated - please be patient with your first post. 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
Re: Compilation and Class Generation newbie questions
Hi! Thanks, i think i haven't executed java from command line for a while and forgot some things. ;-) On Mon, Feb 15, 2010 at 11:32 AM, Meikel Brandmeyer wrote: > Hi, > > On Feb 15, 6:13 am, Paulo Sérgio Medeiros wrote: > > > I think i've not figured out yet how compile and/or namespace works. > > > > I'm trying to execute the example posted inhttp:// > clojure.org/compilation > > > > I've created a file named "hello.clj" and put the clojure.jar in the same > > directory (c:\clojure_tests). > > > > Then, i started the REPL using the command: java -cp clojure.jar > > clojure.main > > > > And executed (compile 'clojure.examples.hello), but i'm getting the > > following error: > > > > java.io.FileNotFoundException: Could not locate > > clojure/examples/hello__init.class or clojure/examples/hello.clj on > > classpath: (NO_SOURCE_FILE:0) > > > > If i execute compile with a different namespace like (compile 'hello) > then i > > get the following error: > > > > java.io.IOException: The system cannot find the path specified > (hello.clj:1) > > > > Is there any relationship between the namespace name and the file name? > How > > compile determines which file is going to be compiled? > > From http://clojure.org/compilation: > > For some namespace my.domain.lib, defined in my/domain/lib.clj, in > the classpath, ... > > So put your file in src/clojure/examples/hello.clj. Create also a > directory called classes. Then invoke clojure with > >java -cp src;classes;clojure.jar clojure.main -r > > and compile the namespace as you did before. The compiled classes will > end up in the classes directory. > > Sincerely > Meikel > > -- > 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 > Note that posts from new members are moderated - please be patient with > your first post. > 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 > -- 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 Note that posts from new members are moderated - please be patient with your first post. 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