Re: Classpath set by lein swank or clojure-jack-in
On Sat, Jun 16, 2012 at 10:10 AM, Dave Kincaid kincaid.d...@gmail.com wrote: Sure can. Here is the project.clj: (defproject swank-test 0.1 :source-path src/main/clj Are you using lein 1.x or lein 2.x? In lein 2.x you need to use `:source-paths [src/main/clj]` here. :test-path test/clj :java-source-path src/main/java The same goes for :test-paths and :java-source-paths. The leiningen girhub repository has a sample project.clj which is where I looked this up (in case you need to look something else up later). https://github.com/technomancy/leiningen/blob/master/sample.project.clj :javac-options {:debug true :fork true} :resources-path src/main/resources :dependencies [[org.clojure/clojure 1.4.0] [cascalog 1.9.0] [org.apache.hadoop/hadoop-core 0.20.2 :exclusions [hsqldb/hsqldb]]]) I have a file named generator.clj in src/main/clj. When I do a lein swank from the directory that project.clj is in then run slime-connect in Emacs with the generator.clj file open. Then I try to do (use 'generator) and get Could not locate generator__init.class or generator.clj on classpath: [Thrown class java.io.FileNotFoundException] When I do this with your supplied project.clj with lein 1.x it works. With lein2.x and the changes outlined above it also works. -- 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: Classpath set by lein swank or clojure-jack-in
Thank you, Carlo! That was it! I'm using Leingingen 2. It's working great now. Dave On Saturday, June 16, 2012 8:34:08 PM UTC-5, Carlo wrote: On Sat, Jun 16, 2012 at 10:10 AM, Dave Kincaid kincaid.d...@gmail.com wrote: Sure can. Here is the project.clj: (defproject swank-test 0.1 :source-path src/main/clj Are you using lein 1.x or lein 2.x? In lein 2.x you need to use `:source-paths [src/main/clj]` here. :test-path test/clj :java-source-path src/main/java The same goes for :test-paths and :java-source-paths. The leiningen girhub repository has a sample project.clj which is where I looked this up (in case you need to look something else up later). https://github.com/technomancy/leiningen/blob/master/sample.project.clj :javac-options {:debug true :fork true} :resources-path src/main/resources :dependencies [[org.clojure/clojure 1.4.0] [cascalog 1.9.0] [org.apache.hadoop/hadoop-core 0.20.2 :exclusions [hsqldb/hsqldb]]]) I have a file named generator.clj in src/main/clj. When I do a lein swank from the directory that project.clj is in then run slime-connect in Emacs with the generator.clj file open. Then I try to do (use 'generator) and get Could not locate generator__init.class or generator.clj on classpath: [Thrown class java.io.FileNotFoundException] When I do this with your supplied project.clj with lein 1.x it works. With lein2.x and the changes outlined above it also works. -- 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
Classpath set by lein swank or clojure-jack-in
One of the things that really been holding me back from moving ahead with Clojure is the difficulty I have running code that I'm writing using a repl. I generally use Emacs to code Clojure and I really don't understand how the classpath gets set when I use either lein swank + slime-connect or clojure-jack-in. I can't seem to get it to find either any dependencies that I've included in the project.clj or any of my own code without a lot of hit and miss trial and error. Eventually I can usually get it to work by doing all kind of things like compiling the .clj file, launching lein swank from different directories, etc. Is there a good document that I could read to understand how I should be doing this. It's so frustrating that I don't even want to try writing Clojure code most of the time eventhough I'm loving the language. Thanks, Dave -- 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: Classpath set by lein swank or clojure-jack-in
Once I got lein swank and slime-connect working in emacs, I essentially stopped using the repl directly. The real magic and beauty of writing clojure in emacs is that I can write a fn, then C-x C-e to evaluate it right there in the file. I can evaluate inner forms, test every line of the file to confirm it works, experiment, etc, and the code is all saved in the file. I don't want to write anything *other* than clojure because it's such a beautiful and effective experience. -Original Message- From: Dave Kincaid kincaid.d...@gmail.com Sender: clojure@googlegroups.com Date: Fri, 15 Jun 2012 14:47:10 To: clojure@googlegroups.com Reply-To: clojure@googlegroups.com Subject: Classpath set by lein swank or clojure-jack-in One of the things that really been holding me back from moving ahead with Clojure is the difficulty I have running code that I'm writing using a repl. I generally use Emacs to code Clojure and I really don't understand how the classpath gets set when I use either lein swank + slime-connect or clojure-jack-in. I can't seem to get it to find either any dependencies that I've included in the project.clj or any of my own code without a lot of hit and miss trial and error. Eventually I can usually get it to work by doing all kind of things like compiling the .clj file, launching lein swank from different directories, etc. Is there a good document that I could read to understand how I should be doing this. It's so frustrating that I don't even want to try writing Clojure code most of the time eventhough I'm loving the language. Thanks, Dave -- 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
Re: Classpath set by lein swank or clojure-jack-in
I'm with you, Peter. The problem is I can't get lein swank and slime-connect working in a consistent way. It starts up fine but can't find any dependencies that I try to (use ...) or even any of the code in my .clj files that I try to access. I just can't understand what it's using as a classpath when it's launched. When I do stumble on the right combination of directory, lein swank and emacs buffer it is awesome! On Friday, June 15, 2012 5:42:59 PM UTC-5, Peter wrote: Once I got lein swank and slime-connect working in emacs, I essentially stopped using the repl directly. The real magic and beauty of writing clojure in emacs is that I can write a fn, then C-x C-e to evaluate it right there in the file. I can evaluate inner forms, test every line of the file to confirm it works, experiment, etc, and the code is all saved in the file. I don't want to write anything *other* than clojure because it's such a beautiful and effective experience. -- *From: * Dave Kincaid kincaid.d...@gmail.com *Sender: * clojure@googlegroups.com *Date: *Fri, 15 Jun 2012 14:47:10 -0700 (PDT) *To: *clojure@googlegroups.com *ReplyTo: * clojure@googlegroups.com *Subject: *Classpath set by lein swank or clojure-jack-in One of the things that really been holding me back from moving ahead with Clojure is the difficulty I have running code that I'm writing using a repl. I generally use Emacs to code Clojure and I really don't understand how the classpath gets set when I use either lein swank + slime-connect or clojure-jack-in. I can't seem to get it to find either any dependencies that I've included in the project.clj or any of my own code without a lot of hit and miss trial and error. Eventually I can usually get it to work by doing all kind of things like compiling the .clj file, launching lein swank from different directories, etc. Is there a good document that I could read to understand how I should be doing this. It's so frustrating that I don't even want to try writing Clojure code most of the time eventhough I'm loving the language. Thanks, Dave -- 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
Re: Classpath set by lein swank or clojure-jack-in
That's strange. You usually just run lein swank in the folder with you project.clj. Nothing to do wrong there. Can you show the project.clj and the directory structure of a non-working project? -- Sent from my mobile Am 16.06.2012 01:07 schrieb Dave Kincaid kincaid.d...@gmail.com: I'm with you, Peter. The problem is I can't get lein swank and slime-connect working in a consistent way. It starts up fine but can't find any dependencies that I try to (use ...) or even any of the code in my .clj files that I try to access. I just can't understand what it's using as a classpath when it's launched. When I do stumble on the right combination of directory, lein swank and emacs buffer it is awesome! On Friday, June 15, 2012 5:42:59 PM UTC-5, Peter wrote: Once I got lein swank and slime-connect working in emacs, I essentially stopped using the repl directly. The real magic and beauty of writing clojure in emacs is that I can write a fn, then C-x C-e to evaluate it right there in the file. I can evaluate inner forms, test every line of the file to confirm it works, experiment, etc, and the code is all saved in the file. I don't want to write anything *other* than clojure because it's such a beautiful and effective experience. -- *From: * Dave Kincaid kincaid.d...@gmail.com *Sender: * clojure@googlegroups.com *Date: *Fri, 15 Jun 2012 14:47:10 -0700 (PDT) *To: *clojure@googlegroups.com *ReplyTo: * clojure@googlegroups.com *Subject: *Classpath set by lein swank or clojure-jack-in One of the things that really been holding me back from moving ahead with Clojure is the difficulty I have running code that I'm writing using a repl. I generally use Emacs to code Clojure and I really don't understand how the classpath gets set when I use either lein swank + slime-connect or clojure-jack-in. I can't seem to get it to find either any dependencies that I've included in the project.clj or any of my own code without a lot of hit and miss trial and error. Eventually I can usually get it to work by doing all kind of things like compiling the .clj file, launching lein swank from different directories, etc. Is there a good document that I could read to understand how I should be doing this. It's so frustrating that I don't even want to try writing Clojure code most of the time eventhough I'm loving the language. Thanks, Dave -- 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+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/**group/clojure?hl=enhttp://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 -- 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: Classpath set by lein swank or clojure-jack-in
Sure can. Here is the project.clj: (defproject swank-test 0.1 :source-path src/main/clj :test-path test/clj :java-source-path src/main/java :javac-options {:debug true :fork true} :resources-path src/main/resources :dependencies [[org.clojure/clojure 1.4.0] [cascalog 1.9.0] [org.apache.hadoop/hadoop-core 0.20.2 :exclusions [hsqldb/hsqldb]]]) I have a file named generator.clj in src/main/clj. When I do a lein swank from the directory that project.clj is in then run slime-connect in Emacs with the generator.clj file open. Then I try to do (use 'generator) and get Could not locate generator__init.class or generator.clj on classpath: [Thrown class java.io.FileNotFoundException] what am I doing wrong? On Friday, June 15, 2012 6:26:02 PM UTC-5, Moritz Ulrich wrote: That's strange. You usually just run lein swank in the folder with you project.clj. Nothing to do wrong there. Can you show the project.clj and the directory structure of a non-working project? -- Sent from my mobile Am 16.06.2012 01:07 schrieb Dave Kincaid kincaid.d...@gmail.com: I'm with you, Peter. The problem is I can't get lein swank and slime-connect working in a consistent way. It starts up fine but can't find any dependencies that I try to (use ...) or even any of the code in my .clj files that I try to access. I just can't understand what it's using as a classpath when it's launched. When I do stumble on the right combination of directory, lein swank and emacs buffer it is awesome! On Friday, June 15, 2012 5:42:59 PM UTC-5, Peter wrote: Once I got lein swank and slime-connect working in emacs, I essentially stopped using the repl directly. The real magic and beauty of writing clojure in emacs is that I can write a fn, then C-x C-e to evaluate it right there in the file. I can evaluate inner forms, test every line of the file to confirm it works, experiment, etc, and the code is all saved in the file. I don't want to write anything *other* than clojure because it's such a beautiful and effective experience. -- *From: * Dave Kincaid kincaid.d...@gmail.com *Sender: * clojure@googlegroups.com *Date: *Fri, 15 Jun 2012 14:47:10 -0700 (PDT) *To: *clojure@googlegroups.com *ReplyTo: * clojure@googlegroups.com *Subject: *Classpath set by lein swank or clojure-jack-in One of the things that really been holding me back from moving ahead with Clojure is the difficulty I have running code that I'm writing using a repl. I generally use Emacs to code Clojure and I really don't understand how the classpath gets set when I use either lein swank + slime-connect or clojure-jack-in. I can't seem to get it to find either any dependencies that I've included in the project.clj or any of my own code without a lot of hit and miss trial and error. Eventually I can usually get it to work by doing all kind of things like compiling the .clj file, launching lein swank from different directories, etc. Is there a good document that I could read to understand how I should be doing this. It's so frustrating that I don't even want to try writing Clojure code most of the time eventhough I'm loving the language. Thanks, Dave -- 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+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/**group/clojure?hl=enhttp://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 -- 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: Classpath set by lein swank or clojure-jack-in
Have you tried visiting the project.clj file in Emacs and then doing M-x clojure-jack-in ? That should start lein swank in the project directory and pull in all the dependencies as expected. (you should start lein swank in the project root directory - containing project.clj - not in a subdirectory) On Fri, Jun 15, 2012 at 5:10 PM, Dave Kincaid kincaid.d...@gmail.com wrote: Sure can. Here is the project.clj: (defproject swank-test 0.1 :source-path src/main/clj :test-path test/clj :java-source-path src/main/java :javac-options {:debug true :fork true} :resources-path src/main/resources :dependencies [[org.clojure/clojure 1.4.0] [cascalog 1.9.0] [org.apache.hadoop/hadoop-core 0.20.2 :exclusions [hsqldb/hsqldb]]]) I have a file named generator.clj in src/main/clj. When I do a lein swank from the directory that project.clj is in then run slime-connect in Emacs with the generator.clj file open. Then I try to do (use 'generator) and get Could not locate generator__init.class or generator.clj on classpath: [Thrown class java.io.FileNotFoundException] what am I doing wrong? -- 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: Classpath set by lein swank or clojure-jack-in
Probably over-cautious because of my ignorance, but I don't know if I would name the project swank-test as I haven't paid too close attention to what seems a slightly confusing rule about dashes in namespaces and underscores in filenames - also swank-test might be some sort of existing namespace that secretly gets loaded and oddly conflicts. I also haven't done much with directory structure under the src/project-name folder - do you have the same problems with a project that only has one file, or only files in that folder? Like I said this is mostly based on my ignorance, and getting a handle on the namespacing is probably a good idea, but I've never had an issue with my small projects with flat/default directory structures. Might workaround it for you in the short term. -Original Message- From: Sean Corfield seancorfi...@gmail.com Sender: clojure@googlegroups.com Date: Fri, 15 Jun 2012 18:44:46 To: clojure@googlegroups.com Reply-To: clojure@googlegroups.com Subject: Re: Classpath set by lein swank or clojure-jack-in Have you tried visiting the project.clj file in Emacs and then doing M-x clojure-jack-in ? That should start lein swank in the project directory and pull in all the dependencies as expected. (you should start lein swank in the project root directory - containing project.clj - not in a subdirectory) On Fri, Jun 15, 2012 at 5:10 PM, Dave Kincaid kincaid.d...@gmail.com wrote: Sure can. Here is the project.clj: (defproject swank-test 0.1 :source-path src/main/clj :test-path test/clj :java-source-path src/main/java :javac-options {:debug true :fork true} :resources-path src/main/resources :dependencies [[org.clojure/clojure 1.4.0] [cascalog 1.9.0] [org.apache.hadoop/hadoop-core 0.20.2 :exclusions [hsqldb/hsqldb]]]) I have a file named generator.clj in src/main/clj. When I do a lein swank from the directory that project.clj is in then run slime-connect in Emacs with the generator.clj file open. Then I try to do (use 'generator) and get Could not locate generator__init.class or generator.clj on classpath: [Thrown class java.io.FileNotFoundException] what am I doing wrong? -- 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
Re: Classpath set by lein swank or clojure-jack-in
Thanks I'll give those things a try. swank-test was just a small project I threw together as an example for this post. The directory structure is the same as my big project though. I'll play around with your suggestions and see if I can find a pattern to when it works and when it doesn't. Thanks, Dave On Friday, June 15, 2012 9:10:21 PM UTC-5, Peter wrote: Probably over-cautious because of my ignorance, but I don't know if I would name the project swank-test as I haven't paid too close attention to what seems a slightly confusing rule about dashes in namespaces and underscores in filenames - also swank-test might be some sort of existing namespace that secretly gets loaded and oddly conflicts. I also haven't done much with directory structure under the src/project-name folder - do you have the same problems with a project that only has one file, or only files in that folder? Like I said this is mostly based on my ignorance, and getting a handle on the namespacing is probably a good idea, but I've never had an issue with my small projects with flat/default directory structures. Might workaround it for you in the short term. -Original Message- From: Sean Corfield seancorfi...@gmail.com Sender: clojure@googlegroups.com Date: Fri, 15 Jun 2012 18:44:46 To: clojure@googlegroups.com Reply-To: clojure@googlegroups.com Subject: Re: Classpath set by lein swank or clojure-jack-in Have you tried visiting the project.clj file in Emacs and then doing M-x clojure-jack-in ? That should start lein swank in the project directory and pull in all the dependencies as expected. (you should start lein swank in the project root directory - containing project.clj - not in a subdirectory) On Fri, Jun 15, 2012 at 5:10 PM, Dave Kincaid kincaid.d...@gmail.com wrote: Sure can. Here is the project.clj: (defproject swank-test 0.1 :source-path src/main/clj :test-path test/clj :java-source-path src/main/java :javac-options {:debug true :fork true} :resources-path src/main/resources :dependencies [[org.clojure/clojure 1.4.0] [cascalog 1.9.0] [org.apache.hadoop/hadoop-core 0.20.2 :exclusions [hsqldb/hsqldb]]]) I have a file named generator.clj in src/main/clj. When I do a lein swank from the directory that project.clj is in then run slime-connect in Emacs with the generator.clj file open. Then I try to do (use 'generator) and get Could not locate generator__init.class or generator.clj on classpath: [Thrown class java.io.FileNotFoundException] what am I doing wrong? -- 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