Update: Using jclouds 1.5.1
I’m just starting to get familiar with the open source jclouds cross-cloud toolkit. Whenever I get started with something new like this I like to start out with the most simple application possible that still does something sort of useful. And when starting out, I prefer to work from the command line so I can get a feel for how something is really put together. After that, when I move to using a build tool like Maven or Ant or putting everything into Eclipse or another IDE, I have a better understanding of its dependecies and config.
With that in mind I headed over to the jclouds installation page to download the JARs for it. Okay…what is lein???
Looks lein is part of leiningen. One of the tools that jclouds can use to manage dependencies. Downloading the lein script is no problem but I also need the project.clj file. No problem…but what version to put in the dependencies list?
After sifting through the jclouds group and jclouds-dev groups I find a post that points to beta.10 being the latest and greatest. I find a blog that points to 1.5.1 being the latest and greatest. I’ll try putting that in the project.clj file and give it a shot.
That’s a lot of JARs.
Now all I want to do is list all of my servers on the Rackspace open cloud. After some trial and error I came up with the following app.
Follow the instructions below to compile and run the app. Thankfully Java 1.6 allows for wildcard expansion on the command line, otherwise it would be a serious pain including all of those JARs.
There you have it. If anyone is more familiar with lein and/or leiningen and can show me how to limit it to downloading just the JARs I need, let me know in the comments.
This post was written on Mac OS X 10.8, Java 1.6.0, jclouds 1.5.1 1.5.0-beta.10. If you’re on a different OS and run into problems, please feel free to comment.

jclouds (@jclouds)
August 15, 2012 at 4:51 pm
Hi, Everett!
Nice post, and thanks!
Here’s a couple things to help…
to limit jars to just what you need, replace org.jclouds/jclouds-all with org.jclouds.provider/rackspace-cloudservers-us; also, to list nodes, you don’t need ssh, so you can take that dep out.
also, and since you have lein anyway
try this, to kick the tires on clojure!
lein repl
(use ‘org.jclouds.compute2)
(def compute (compute-service “rackspace-cloudservers-us” “my-username” “my-api-key”))
(pprint (nodes compute))
Have fun!
Everett Toews
August 15, 2012 at 7:19 pm
Ah ha! I see now. project.clj is just Clojure source code. I haven’t had any exposure to Clojure so I didn’t even recognize what that file was. Well I know now…and I’ve run my first Clojure app.
Thanks!
shivani kaushal (@shivanikaushal)
May 14, 2013 at 6:52 am
hi,
i tried doing exactly same steps, but jars are not downloaded. A folder with name “stale” got created in target directory instead. Do you have any idea what the problem could be?
Thanks,
Shivani
Everett Toews
May 14, 2013 at 9:59 am
This blog post is very out-of-date at this point. I recommend going to http://www.jclouds.org/documentation/quickstart/rackspace/ for the latest instructions. Good luck!
shivani kaushal (@shivanikaushal)
May 15, 2013 at 2:01 am
Thanks!
solved it after some trial and error. Thanks for the link.