Opened 9 years ago

Last modified 4 years ago

#28684 new defect

Clojure won't compile my programs

Reported by: mcandre (Andrew Pennebaker) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc:
Port: clojure


It seems that Clojure doesn't add the current directory to the compile path.


  • Clojure 1.2.0
  • MacPorts 1.9.2
  • Mac OS X 10.6.6
  • MacBook Pro 5,1
$ cat hello.clj 
#!/usr/bin/env clj

(println "Hello World!")
$ clj hello.clj 
Hello World!
$ clj
Clojure 1.2.0
user=> (compile 'hello)
Hello World! No such file or directory (NO_SOURCE_FILE:0)
user=> *compile-path*

Change History (5)

comment:1 Changed 9 years ago by mcandre (Andrew Pennebaker)

The problem disappears when "." is added to the compile path. Maybe this variable can be augmented in future releases.

user=> (set! *compile-path* ".")
user=> (compile 'hello)
Hello World!

comment:2 Changed 9 years ago by ryandesign (Ryan Schmidt)

Owner: changed from macports-tickets@… to mdippery@…

comment:3 Changed 9 years ago by mcandre (Andrew Pennebaker)

This problem causes the compilation tutorial ( to fail:

$ java -cp ./classes:clojure.jar clojure.examples.hello Fred
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/examples/hello
Caused by: java.lang.ClassNotFoundException: clojure.examples.hello
	at Method)
	at java.lang.ClassLoader.loadClass(
	at sun.misc.Launcher$AppClassLoader.loadClass(
	at java.lang.ClassLoader.loadClass(

Those examples and the current path "." should belong in *compile-path*.

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

Owner: changed from mdippery@… to macports-tickets@…

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

Is this still a problem with 1.7.0?

Note: See TracTickets for help on using tickets.