JRuby uses JRUBY_HOME, which contains jruby.jar, a few other other essential
jars and gems, and any locally installed gems. (Gems are ruby's packaging
mechanism.)  It also includes a jruby (jruby.bat on windows) executable
script.  This script parses command line args, sets up the classpath using
JRUBY_HOME, and if the first arg is a ruby file, evaluates that file.  It
supports options for adding to the 'include path'.  I'm not sure but I think
groovy does something similar.

If something similar were created for clojure, newbie instructions might
look like this.

1.  Download and unpack clojure-for-newbies.zip
2.  Add clojure-for-newbies/bin to your PATH.
3.  Create hello_world.clj with the following contents:
     (println "hello world")
4.  Type 'clojure hello_world.clj' to invoke your script

The 'clojure' script could also support options for adding jars and .clj
files to the class/load path.  With this approach a newbie could go a long
way without having to worry about lein/maven, projects, packaging,
compiling, etc.

On the other hand I did find it very easy to get started with lein (can't
remember how to spell its full name).   I love 'lein repl' (in spite of its
current limitations) - very newbie friendly for me as I could start
experimenting right away.  I have found clojure to be pretty newbie
friendly, but I do come from a Java background.

Steve



On Wed, Jun 30, 2010 at 3:14 PM, Brian Schlining <bschlin...@gmail.com>wrote:

>
>> >
>> > May I propose as a possible remedy CLOJURE_HOME. CLOJURE_HOME is the
>> absolute path of a directory containing clojure.jar and possibly
>> clojure-contrib.jar. Scripts should check if it's defined and use it instead
>> of hard-coded paths, as an example, here's my clj script (in newLISP):
>>
>> On the face of it this seems like a good idea, however it doesn't
>> really fit with the models used by tools such as leiningen, mvn or the
>> JVM.  At best a CLOJURE_HOME initiative can only expect to work within
>> its own world of clj scripts etc.
>>
>
> I can't speak for leiningen but many (most?) launcher script in the Java
> world use this as a standard convention. If you look through the launcher
> scripts for maven, groovy, scala, ant, etc you will see environment
> variables JAVA_HOME, M2_HOME (for Maven 2), GROOVY_HOME, SCALA_HOME and
> ANT_HOME.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com<clojure%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to