Fixing Maven-Eclipse with imglib2

Hey there,

I somehow broke my eclipse and am unable to use ImageJFunctions to open the images via the maven based java programs I have in that project. It throws the following error:

Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: net.imglib2.img.array.ArrayImgFactory.<init>(Lnet/imglib2/type/NativeType;)V
 at net.imglib2.img.display.imagej.ImageJVirtualStack.getSlice(
 at net.imglib2.img.display.imagej.ImageJVirtualStack.getPixelsZeroBasedIndex(
 at net.imglib2.img.display.imagej.AbstractVirtualStack.getPixels(
 at net.imglib2.img.display.imagej.AbstractVirtualStack.getProcessor(
 at ij.ImagePlus.setStack(
 at ij.ImagePlus.<init>(
 at net.imglib2.img.display.imagej.ImageJFunctions.makeImagePlus(
 at net.imglib2.img.display.imagej.ImageJFunctions.wrapFloat(
 at net.imglib2.img.display.imagej.ImageJFunctions.wrap(

My pom.xml has scijava version 25.0.0 and these other dependencies: 



 	<!-- ImageJ dependencies -->

Hi @kapoorlab!

Hmm, I tried to reproduce your issue but no luck.

Maybe open your pom.xml in eclipse and compare the versions that were resolved with what Iā€™m getting:

This is the parent pom I used:

		<relativePath />



Thanks John, It turned out that I had a local scifio repo which was in my maven dependencies and that was causing the problem. Removing that as a dependency resolved the issue.

1 Like