MacPorts, Clojure and ClassNotFoundException

After installing Clojure with MacPorts I got the following exception when running a basic Clojure script:

Exception in thread "main" java.lang.NoClassDefFoundError: Pad:/opt/local/share/java/clojure/bin////lib/clojure/jar
Caused by: java.lang.ClassNotFoundException:
	at Method)
	at java.lang.ClassLoader.loadClass(
	at sun.misc.Launcher$AppClassLoader.loadClass(
	at java.lang.ClassLoader.loadClass(

As it turned out, I had run the script from a folder with a space in it’s name, “Scratch Pad”. After moving the script to an other folder, the script ran just fine.

How to sync MacPorts without rsync

If port 873 is blocked on your network and you need to sync MacPorts do this:

In /opt/local/etc/macports/sources.conf replace

rsync:// [default]

with [default]

and run

sudo port sync

instead of

sudo port selfupdate

MacPorts is now synching using http over port 80 instead of rsync over port 873.