[ImageJ-devel] failed to run imageJ2

Johannes Schindelin Johannes.Schindelin at gmx.de
Fri Jun 14 10:13:27 CDT 2013


Hi Mohamed,

On Fri, 14 Jun 2013, Mohamed Tleis wrote:

> I downloaded the latest version of imageJ2 beta 7, and created a very
> simple program to run imageJ as follows:
> 
> public static void main(String args[])
> {
>     final ImageJ ij = imagej.Main.launch(args);
> }

A couple of comments:

- if you want to use ImageJ2 as an application, please use the ImageJ
  launcher instead of writing your own main() method.

- if you want to use parts of ImageJ2 as a library, please use Maven. The
  problem you got:

> java.lang.NoClassDefFoundError: io/scif/io/img/ImgIOException

  is exactly the problem Maven was designed to solve.

  If you insist on adding each required dependecy to the classpath
  yourself, that is something you can easily do, but it is your
  responsibility, then, to find and list all of the required .jar files.

- to get started on using ImageJ2 as a library, please have a look at the
  imagej-tutorials:

	https://github.com/imagej/imagej-tutorials

  in general, it is a bad idea to use the launch() method from your code:
  it is meant to be used via the command-line. From Java, you would
  instantiate the context yourself:

	ImageJ ij = new ImageJ();
	ij.ui().showUI();

Ciao,
Johannes



More information about the ImageJ-devel mailing list