简体   繁体   中英

Is there a nice and easy installer for Clojure on Mac OS (Leopard)?

I found the following guide:

http://mark.reid.name/sap/setting-up-clojure.html

but it seems like a whole lot of manual steps, and I bet it is out of date already. Installing ClojureBox on Windows was a breeze. Does anyone know of a simple installer for it? Where can I download it, and what are the steps?

Thanks!

EDIT: Tried installing cake, got:

$ sudo gem install cake
Password:
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302

Also tried installing using the script:

$ sudo ./cake_install.rb 
http://github.com/ninjudd/cake-standalone/raw/master/jars/cake-0.5.4.jar
[=============================================================================]
http://build.clojure.org/releases/org/clojure/clojure/1.2.0/clojure-1.2.0.jar
[=============================================================================]
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file (ordered_set.clj:1)

EDIT 2 : Now the Java version issues :) What version of Java do I need and where to download it?

$ sudo cake test
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file (ordered_set.clj:1)

My Leopard software is up to date :(

Apple Computer supplies their own version of Java. Use the Software Update feature (available on the Apple menu) to check that you have the most up-to-date version of Java for your Mac. If you have problems with downloading, installing or using Java on Mac, please contact Apple Computer Technical Support.

EDIT: Hm ... I suspect that one of the suggestions I tried broke my ability to connect to the internet (both wired as well as wireless) on Apple :(

Clojure is also installable via Homebrew:

If you just want to run clojure programs, then macports works. Bear in mind you're dependent upon the maintainer to update versions.

If you plan on writing clojure programs, then cake is a better starting point. Installation involves one of the following (your choice):

Using gem (easiest)

  1. gem install cake

Standalone script

  1. Download the script
  2. Put it somewhere in your path and chmod +x cake to make it executable

Git repository

  1. git clone git://github.com/ninjudd/cake.git
  2. Symlink bin/cake into your path and make it executable

Cake is a full build system, but you can just use it to fire up the repl by running cake repl . There's also leiningen , but starting repls will feel faster in cake since it uses persistent JVMs.

I find Leiningen very easy to use. Just download the script, put it somewhere in your $PATH (/usr/bin/ for example) and make it executable: sudo chmod +x lein . Now type lein repl and Leiningen will download all the files you need and create a REPL for you. It's that easy.

You may want to check CounterClockWise (an Eclipse plugin). There's a video on how to install it here . It'll give you a lot of features to play with - including a clojure REPL.

Just checked this will still work under Ubuntu. It should be the same for macs, except using whatever macs use instead of apt-get to install maven:

http://www.learningclojure.com/2010/08/clojure-emacs-swank-slime-maven-maven.html

You need to install maven, create a file, then you can just call mvn clojure:repl and everything should just work.

If you'd also like the whole emacs-swank-slime setup that's also easy now, and described there.

If you try it can you comment back here or on the blog to let me know if there are any changes I need to make for macs?

安装MacPorts ,然后运行sudo port install clojure

I once created a package called ClojureX that was partly based on Mark's article. It's not actively maintained anymore (at least not by me), but there's no reason it wouldn't work:

http://github.com/citizen428/ClojureX

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM