notallama wrote:
> this may be more of a java question than a clojure question. i dunno.
> 
> how do i use a java class from clojure?
> 
> it's easy enough if it's one of the default java libraries, but so far
> all i have managed with classes i wrote is "unable to resolve to
> classname"
> 
> i tried running the repl from the directory with the classes i want to
> use, but no luck.

You need to set up your classpath correctly. How you do that depends
heavily on how you're launching clojure in the first place. I suspect
it's a batch file or shell script, in which case you just need to append
the path to your class hierarchy (or the jar file containing it) to the
-cp parameter to the java command. On UNIX-like systems, classpath
entries are separated by a colon (:), on Windows, I think it's a
semicolon (;).

So if your class Foo, in package bar is at /tmp/bar/Foo.class, you want
to change the part of the java line from

java -cp path/clojure.jar:otherstuff

to

java -cp path/clojure.jar:otherstuff:/tmp/

Hope that helps
~phil

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