Hi,
The key is to include ij.jar in your class path. But how to do so
depends on your environment.
With the Eclipse IDE, right-click your project, hit Properties, choose
the Java Build Path option, click the Libraries tab, then click the
Add JARs button to include ij.jar.
If you work from the command line, you can set the CLASSPATH
environment variable to include ij.jar. On Windows, right-click My
Computer, choose properties, Advanced tab, click Environment
Variables, and create one called CLASSPATH with the value
"/path/to/ij.jar" (without the quotes), where "/path/to" is the
directory containing the JAR file. On Linux, add the line "export
CLASSPATH=/path/to/ij.jar" to your .bashrc or other relevant
configuration file. On Mac OS X, add it to your .profile.
Alternately, you can compile a program with a particular class path like this:
javac -cp /path/to/ij.jar MyProgram.java
If you have multiple dependencies (i.e., multiple 3rd party JARs), you
can include them all by separating their paths with colons (use
semicolons on Windows). E.g.:
javac -cp /path/to/ij.jar:/path/to/anotherLib.jar MyProgram.java
Another option is to use Ant to create a build script to compile and
run your program from the command line, rather than modify the
CLASSPATH environment variable directly. The software my group
develops (
http://loci.wisc.edu/software/) uses this method to allow
users to check out our codebase from our Subversion repository and
build it immediately without needing to muck around with the class
path.
-Curtis
On 8/8/07, mobitel <bmw850csi3_kl@hotmail.com> wrote:
> Hello,
>
> Is it possible to give me an example, I do work with java for years, but
> NEVER needed to import any kind of API or 3rd party class, or library.
>
>
>
> Curtis Rueden wrote:
> >
> > Hi,
> >
> > If your application is in Java, just use the ImageJ classes like any
> > other Java API. You can find the Javadocs online at:
> >
> >
http://rsb.info.nih.gov/ij/developer/api/index.html> >
> > and you can browse the source code at:
> >
> >
http://rsb.info.nih.gov/ij/developer/source/index.html> >
> > If you want to write plugins, check out Werner Bailer's plugins tutorial:
> >
> >
http://mtd.fh-hagenberg.at/depot/imaging/imagej/> >
> > For more information, see the ImageJ web site's developer resources page:
> >
> >
http://rsb.info.nih.gov/ij/developer/index.html> >
> > -Curtis
> >
> > On 8/3/07, mobitel <bmw850csi3_kl@hotmail.com> wrote:
> >> Hello,
> >>
> >> I want to use imagej libraries for my project, but I dont know how to
> >> call
> >> them within the application.
> >> For example, I want to use threshold from imagej, how do I call it?
> >>
> >> Thanks
> >> --
> >> View this message in context:
> >>
http://www.nabble.com/how-can-i-import-imagej-libraries-in-my-project--tf4207392.html#a11968657> >> Sent from the ImageJ mailing list archive at Nabble.com.
> >>
> >
> >
>
> --
> View this message in context:
http://www.nabble.com/how-can-i-import-imagej-libraries-in-my-project--tf4207392.html#a12052523> Sent from the ImageJ mailing list archive at Nabble.com.
>