Re: Can't locate str_utils in classpath

2010-11-02 Thread Rasmus Svensson
2010/10/31 Steven Arnold thoth.amon.i...@gmail.com:
 Hello, I am trying to use the str-utils library with Clojure (or the
 str-utils2, I understand str-utils was deprecated).  Neither of these
 work for me.  I am on OS X 10.6.4 and have installed clojure-contrib
 via the MacPorts system.  The clojure-contrib is in my classpath; see
 below for a transcript of what I did.

 I have been struggling with this for hours, searching through Google,
 asking on the IRC channelall to load a library from clojure-
 contrib.  Any ideas what I'm missing

This is not an answer to your original question, but I hope you find
this useful anyway (if not now, some time in the future).

Managing the classpath manually can indeed be tedious. Unless you for
some reason really need to do it manually, I would recommend using one
of Clojure's build tools (Leiningen[1] and Cake[2] are very common) to
manage it for you. Here is an example of how you would do it with
Leiningen (assuming it is installed; see the instructions on its web
page):

lein new foobar
cd foobar/
editor of choice project.clj

With Leiningen and Cake (they use the same project structure), you
declare the versions of Clojure, Contrib and any other dependencies
you need in the project.clj file. Here is an example of it for using
Clojure 1.2:

(defproject foobar 1.0.0-SNAPSHOT
  :description FIXME: write
  :dependencies [[org.clojure/clojure 1.2.0]
 [org.clojure/clojure-contrib 1.2.0]])

Leiningen will fetch the correct versions of the jar files and set up
the classpath for you:

lein deps
lein repl

Happy hacking!

// raek

[1] http://github.com/technomancy/leiningen
[2] http://github.com/ninjudd/cake

-- 
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: Can't locate str_utils in classpath

2010-10-31 Thread Steven Arnold
That was it.  I had to add the entire path up to and including to
contrib jar in order for clj to work.  Merely adding the directory
to the classpath was not sufficient, and the clj script ignored the
value of my env variable $CLASSPATH, so I had to edit the clj script
itself to get this working.

steven

On Oct 30, 11:11 pm, Santosh Rajan santra...@gmail.com wrote:
 Is the contrib.jar in your 'clj' script classpath?

 On Sun, Oct 31, 2010 at 10:18 AM, Steven Arnold
 thoth.amon.i...@gmail.comwrote:



  Hello, I am trying to use the str-utils library with Clojure (or the
  str-utils2, I understand str-utils was deprecated).  Neither of these
  work for me.  I am on OS X 10.6.4 and have installed clojure-contrib
  via the MacPorts system.  The clojure-contrib is in my classpath; see
  below for a transcript of what I did.

  I have been struggling with this for hours, searching through Google,
  asking on the IRC channelall to load a library from clojure-
  contrib.  Any ideas what I'm missing?

  [ 10:41 PM (58) aleph:thoth ~/Source/clojure ]  echo $CLASSPATH
  /opt/local/share/java/clojure/lib
  [ 10:41 PM (59) aleph:thoth ~/Source/clojure ]  ls -al $CLASSPATH
  total 8200
  drwxr-xr-x  5 root  admin      170 Oct 29 23:00 .
  drwxr-xr-x  5 root  admin      170 Oct  3 23:14 ..
  -rw-r--r--@ 2 root  admin   477050 Oct 29 23:35 clojure-contrib.jar
  -rw-r--r--@ 2 root  admin  3237168 Oct  3 23:14 clojure.jar
  [ 10:41 PM (60) aleph:thoth ~/Source/clojure ]  clj
  Clojure 1.2.0
  user= (use 'clojure.contrib.str-utils)
  java.io.FileNotFoundException: Could not locate clojure/contrib/
  str_utils__init.class or clojure/contrib/str_utils.clj on classpath:
  (NO_SOURCE_FILE:0)
  user= (use 'clojure.contrib.str-utils2)
  java.io.FileNotFoundException: Could not locate clojure/contrib/
  str_utils2__init.class or clojure/contrib/str_utils2.clj on
  classpath:  (NO_SOURCE_FILE:0)

  Thanks,
  steven

  --
  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.comclojure%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

 --http://hi.im/santosh

-- 
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: Can't locate str_utils in classpath

2010-10-31 Thread Mike Meyer
On Sun, 31 Oct 2010 00:09:31 -0700 (PDT)
Steven Arnold thoth.amon.i...@gmail.com wrote:

 That was it.  I had to add the entire path up to and including to
 contrib jar in order for clj to work.  Merely adding the directory
 to the classpath was not sufficient, and the clj script ignored the
 value of my env variable $CLASSPATH, so I had to edit the clj script
 itself to get this working.

Hi Steve,

You ought to be able to add path/to/directory/\* to your CLASSPATH
to pick up all the jars in the directory. The * needs to be quoted
to show up in the variable, and not expanded by the shell.  This works
on Unix and Windows, so it ought to work on OSX.

If you're interested in how to work with clojure with minimal Java
infrastructure, I posted my writeup at
http://www.mired.org/home/mwm/papers/simple-clojure.html

mike

-- 
Mike Meyer m...@mired.org http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O ascii ribbon campaign - stop html mail - www.asciiribbon.org

-- 
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


Can't locate str_utils in classpath

2010-10-30 Thread Steven Arnold
Hello, I am trying to use the str-utils library with Clojure (or the
str-utils2, I understand str-utils was deprecated).  Neither of these
work for me.  I am on OS X 10.6.4 and have installed clojure-contrib
via the MacPorts system.  The clojure-contrib is in my classpath; see
below for a transcript of what I did.

I have been struggling with this for hours, searching through Google,
asking on the IRC channelall to load a library from clojure-
contrib.  Any ideas what I'm missing?

[ 10:41 PM (58) aleph:thoth ~/Source/clojure ]  echo $CLASSPATH
/opt/local/share/java/clojure/lib
[ 10:41 PM (59) aleph:thoth ~/Source/clojure ]  ls -al $CLASSPATH
total 8200
drwxr-xr-x  5 root  admin  170 Oct 29 23:00 .
drwxr-xr-x  5 root  admin  170 Oct  3 23:14 ..
-rw-r--r--@ 2 root  admin   477050 Oct 29 23:35 clojure-contrib.jar
-rw-r--r--@ 2 root  admin  3237168 Oct  3 23:14 clojure.jar
[ 10:41 PM (60) aleph:thoth ~/Source/clojure ]  clj
Clojure 1.2.0
user= (use 'clojure.contrib.str-utils)
java.io.FileNotFoundException: Could not locate clojure/contrib/
str_utils__init.class or clojure/contrib/str_utils.clj on classpath:
(NO_SOURCE_FILE:0)
user= (use 'clojure.contrib.str-utils2)
java.io.FileNotFoundException: Could not locate clojure/contrib/
str_utils2__init.class or clojure/contrib/str_utils2.clj on
classpath:  (NO_SOURCE_FILE:0)

Thanks,
steven

-- 
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: Can't locate str_utils in classpath

2010-10-30 Thread Santosh Rajan
Is the contrib.jar in your 'clj' script classpath?

On Sun, Oct 31, 2010 at 10:18 AM, Steven Arnold
thoth.amon.i...@gmail.comwrote:

 Hello, I am trying to use the str-utils library with Clojure (or the
 str-utils2, I understand str-utils was deprecated).  Neither of these
 work for me.  I am on OS X 10.6.4 and have installed clojure-contrib
 via the MacPorts system.  The clojure-contrib is in my classpath; see
 below for a transcript of what I did.

 I have been struggling with this for hours, searching through Google,
 asking on the IRC channelall to load a library from clojure-
 contrib.  Any ideas what I'm missing?

 [ 10:41 PM (58) aleph:thoth ~/Source/clojure ]  echo $CLASSPATH
 /opt/local/share/java/clojure/lib
 [ 10:41 PM (59) aleph:thoth ~/Source/clojure ]  ls -al $CLASSPATH
 total 8200
 drwxr-xr-x  5 root  admin  170 Oct 29 23:00 .
 drwxr-xr-x  5 root  admin  170 Oct  3 23:14 ..
 -rw-r--r--@ 2 root  admin   477050 Oct 29 23:35 clojure-contrib.jar
 -rw-r--r--@ 2 root  admin  3237168 Oct  3 23:14 clojure.jar
 [ 10:41 PM (60) aleph:thoth ~/Source/clojure ]  clj
 Clojure 1.2.0
 user= (use 'clojure.contrib.str-utils)
 java.io.FileNotFoundException: Could not locate clojure/contrib/
 str_utils__init.class or clojure/contrib/str_utils.clj on classpath:
 (NO_SOURCE_FILE:0)
 user= (use 'clojure.contrib.str-utils2)
 java.io.FileNotFoundException: Could not locate clojure/contrib/
 str_utils2__init.class or clojure/contrib/str_utils2.clj on
 classpath:  (NO_SOURCE_FILE:0)

 Thanks,
 steven

 --
 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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
http://hi.im/santosh

-- 
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