Thanks! I was bitten by the underscore and dashes thing in the package
name/filesystem.
This example fortunately had that to show me the way to do it.
Thanks for your help.

On Jun 19, 10:42 am, "Stephen C. Gilardi" <[email protected]> wrote:
> On Jun 19, 2009, at 1:02 PM, timshawn wrote:
>
> > Hello clojure developers,
> > I had a question regarding jar-ring up clojure generated source using
> > gen-class.
>
> > When I do a gen-class, and say either :main is true, or add a -main
> > method, the class file that gets generated always has a random prefix.
>
> One important need filled by gen-class is exactly this case: you need  
> a class with a name you can specify completely and use elsewhere.
>
> > I need to enter the Main class in a jar's Manifest, and was wondering
> > how you guys have done it.
>
> There's an example at clojure.contrib.repl_ln.clj. It uses just "(:gen-
> class)" (no options) in its "ns" declaration:
>
> (ns
> ...
>    clojure.contrib.repl-ln
>    (:gen-class)
> ...)
>
> (defn- -main
>    "Main entry point, starts a repl enters the user
>    namespace and processes command line args."
>    [& args]
>    (repl :init
>          (fn []
>            (println "Clojure" (clojure-version))
>            (in-ns 'user)
>            (process-command-line args))))
>
> (this could also have been defn rather than defn- and would behave the  
> same regarding being callable from Java)
>
> When compiled, this produces the class file:
>
> clojure/contrib/repl_ln.class
>
> You can see it in clojure.contrib.jar (either using a tool that can  
> display its contents directly or bar unjarring it: jar xvf  
> clojure.contrib.jar)
>
> If the example above doesn't lead you to a solution, please post more  
> particulars and a simplified example that shows the problem you're  
> seeing.
>
> --Steve
>
>  smime.p7s
> 3KViewDownload
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to