Getting ClassNotFound Error

Tags: #<Tag:0x00007fd542b1b8f8> #<Tag:0x00007fd542b1b790>


I am trying to make a imagej plugin, this project has a dependency of below exception jar, i havethis dependency in my project but after exporting to jar and installing plugin through fiji, it keeps giving me this error.

java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonGenerationException
	at ij.IJ.runUserPlugIn(
	at ij.IJ.runPlugIn(
	at ij.Executer.runCommand(
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.JsonGenerationException
	at java.lang.ClassLoader.loadClass(
	at sun.misc.Launcher$AppClassLoader.loadClass(
	at java.lang.ClassLoader.loadClass(
	... 6 more


The dependency was not installed to your Fiji installation, i.e. you have your plugin jar, but not jackson-core.jar on your classpath.

The easiest way to install all required dependencies into your ImageJ installation is to build your plugin with maven:


This will copy the plugin jar and all dependencies into your Fiji installation.


So i put this in VMarguments but i am getting
Error: Could not find or load main class mvn
Do you have any other method like exporting a jar and install it through jar.


As @imagejan suggested, you can compile the plugin directly using maven. If you are developing in an IDE, you can follow this minimal example.