Search code examples
javapackageimagej

Failed to find ij package


today, I've tried to run my ImageJ plugin My_S but ImageJ always gives off the following Warning:

 Plugin or class not found: "My_S"
 (java.lang.ClassNotFoundException: My_S)

I think that it kind of skips the compiling step, because there is no My_S.class file in the plugin folder. This is a little weird, because it worked before (I tried it for one plugin only though). Then I tried to compile it from the console with

javac My_S.java

which gives off the following qarning:

My_S.java:1: package ij does not exist
import ij.*;
^

So, I tried to re-install it (my system is linux mint btw) but IJ still shows off the same behavior.... : / Are there any suggestions on how to solve this problem? (I hope this is the right place to ask this question)

Thanks


Solution

  • The "ij package" (that is, all classes in ij.*) is found in the ij jar, e.g. ij-1.50e.jar distributed with your ImageJ installation.

    To compile your plugin with javac, see this SO post about adding jars to the classpath.

    However, if you are going to be developing ImageJ plugins regularly I encourage you to learn about the software development tools available, like Maven, which will help you manage dependencies and build your compile-time classpath automatically (among other things).

    You may also be interested in the ImageJ forum, which reaches a more targeted community for ImageJ-specific development issues.