New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #22889 (new defect)

Opened 3 years ago

Last modified 4 weeks ago

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

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

Change History

comment:1 Changed 3 years ago by macsforever2000@…

  • Owner changed from macports-tickets@… to ian.eure@…
  • Cc ian.eure@… removed
  • Priority changed from High to Normal

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

Patch to clj.sh to respect $CLASSPATH

comment:3 Changed 3 years ago by ieure@…

  • Owner changed from ian.eure@… to mdippery@…
  • Port changed from clojure-contrib to clojure

comment:4 Changed 3 years ago by mdippery@…

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

Changed 3 years ago by mdippery@…

Same patch for the rlwrap version

comment:5 Changed 2 years ago by jmr@…

  • Keywords haspatch added; clojure contrib classpath removed
  • Cc ieure@… added
  • Port changed from clojure to clojure clojure-contrib

comment:6 Changed 23 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)

comment:7 Changed 4 weeks ago by raimue@…

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