New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #22889 (new defect)

Opened 2 years ago

Last modified 7 months ago

clojure-contrib with erring CLASSPATH

Reported by: trier@… Owned by: mdippery@…
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

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

Change History

Changed 2 years ago by macsforever2000@…

  • cc ian.eure@… removed
  • owner changed from macports-tickets@… to ian.eure@…
  • priority changed from High to Normal

Changed 2 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 2 years ago by ian.eure@…

Patch to clj.sh to respect $CLASSPATH

Changed 23 months ago by ieure@…

  • owner changed from ian.eure@… to mdippery@…
  • port changed from clojure-contrib to clojure

Changed 19 months ago by mdippery@…

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

Changed 19 months ago by mdippery@…

Same patch for the rlwrap version

Changed 12 months ago by jmr@…

  • keywords haspatch added; clojure contrib classpath removed
  • cc ieure@… added
  • port changed from clojure to clojure clojure-contrib

Changed 7 months ago by conradwt@…

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)
Note: See TracTickets for help on using tickets.