Is it possible to load up .clj files from the classpath of an arbitrary java app? For example, could you proxy HttpServlet and run your servlet as a .clj from within a servlet container? If not, and you have to gen-class the servlet, could the servlet bootstrap the clojure environment and proceed to load additional .clj files off the classpath?

Essentially, I'm trying to figure out the easiest path to incorporate clojure code into an existing java+tomcat environment (although I think this is interesting in many other cases, too.)

Along this note, someone asked a question awhile back about integrating spring with clojure. Is it possible to autowire either proxy or gen-class clojure classes? If so, does anyone have any experience with this scenario?

-Todd

On 6/19/10 10:39 AM, Paul Moore wrote:
On 19 June 2010 17:22, Chas Emerick<cemer...@snowtide.com>  wrote:
If you're just looking to run a script that happens to be on the classpath,
you can do so by prepending an '@' character to the classpath-relative path
to the script.

So, if a directory foo is on your classpath, and a clojure file you'd like
to run is at foo/bar/script.clj, then you can run it with:

java -cp<your_classpath_here>  clojure.main @/bar/script.clj

FWIW, this is noted in the documentation for clojure here:

http://clojure.org/repl_and_main

Nice! Thanks.
Paul.


--
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