Opened 15 years ago

Last modified 12 years ago

#22889 new defect

clojure-contrib with erring CLASSPATH

Reported by: trier@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.8.1
Keywords: haspatch Cc: ieure@…
Port: clojure clojure-contrib

Description

After installing clojure, then the latest clojure-contrib port (see Ticket: 22752 ), I start up clojure and try to load from the clojure-contrib library, but I don't get very far.

Clojure 1.0.0-
user=> (require '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)

I tried setting the CLASSPATH manually to include the clojure-contrib.jar file which was installed in /opt/local/share/java/clojure/lib, but I still get the same problem.

Attachments (2)

patch-file-clj.sh.diff (274 bytes) - added by ian.eure@… 15 years ago.
Patch to clj.sh to respect $CLASSPATH
patch-file-clj-rlwrap.sh.diff (331 bytes) - added by mdippery@… 14 years ago.
Same patch for the rlwrap version

Download all attachments as: .zip

Change History (9)

comment:1 Changed 15 years ago by mf2k (Frank Schima)

Cc: ian.eure@… removed
Owner: changed from macports-tickets@… to ian.eure@…
Priority: HighNormal

comment:2 Changed 15 years ago by ian.eure@…

This may be a bug in the clojure port's clj script; it ignores $CLASSPATH.

The correct way to add elements to the classpath appears to be via the .clojure file:

$ echo /opt/local/share/java/clojure/lib/clojure-contrib.jar >> .clojure
$ clj
Clojure 1.0.0-
user=> (require 'clojure.contrib.str-utils)
nil
user=>

However, I have a patch to make it respect $CLASSPATH.

Changed 15 years ago by ian.eure@…

Attachment: patch-file-clj.sh.diff added

Patch to clj.sh to respect $CLASSPATH

comment:3 Changed 15 years ago by ieure@…

Owner: changed from ian.eure@… to mdippery@…
Port: clojure added; clojure-contrib removed

comment:4 Changed 14 years ago by mdippery@…

Patch looks fine for me, I'd go ahead and commit it.

Changed 14 years ago by mdippery@…

Same patch for the rlwrap version

comment:5 Changed 14 years ago by jmroot (Joshua Root)

Cc: ieure@… added
Keywords: haspatch added; clojure contrib classpath removed
Port: clojure-contrib added

comment:6 Changed 13 years ago by conradwt (Conrad Taylor)

This issue still happens on Clojure 1.2.0. For example, I'm seeing the following issues:

Clojure 1.2.0
user=> (take 10 fibs)  
java.lang.Exception: Unable to resolve symbol: fibs in this context (NO_SOURCE_FILE:2)
user=> (require '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=> (. Math pi)
java.lang.NoSuchFieldException: pi (NO_SOURCE_FILE:4)
user=> (triple 10)
java.lang.Exception: Unable to resolve symbol: triple in this context (NO_SOURCE_FILE:5)

comment:7 Changed 12 years ago by raimue (Rainer Müller)

Owner: changed from mdippery@… to macports-tickets@…
Note: See TracTickets for help on using tickets.