Opened 14 years ago

Last modified 9 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

Description

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

Specs:

  • 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!
java.io.IOException: No such file or directory (NO_SOURCE_FILE:0)
user=> *compile-path*
"classes"

Change History (5)

comment:1 Changed 14 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!
hello

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

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

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

This problem causes the compilation tutorial (http://clojure.org/compilation) 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 java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

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

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

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

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

Is this still a problem with 1.7.0?

Note: See TracTickets for help on using tickets.