Developing ij-Plugins using IntelliJ IDEA > Create Run/Debug Configuration

At this point your project should be setup and should build without errors.

The Ant's build script provided with the module contains target setup-plugins that packages this module plugins into a JAR, then copies this JAR and all needed libraries to subdirectory sandbox/plugins. Now if you start ImageJ pointing it to sandbox directory as location of the plugins it will load this module plugins.

Here are the steps:

  1. Make the project aware of the module's Ant build script.
    1. Open "Ant Build" panel by clicking on "Ant Build" vertical button at the top right of the IDEA window.
    2. Click on "+" button to specify location of the build script.
    3. Navigate to location of the module and select "build.xml"
    4. Click "OK" to select the build script
    5. You should have node named "ij-plugins_Toolkit" in the "Ant Build" panel
  2. Select Run > Edit Configurations
  3. Create new Application configuration
    • Give it a name, say "ImageJ
    • Set the main class as: ij.ImageJ
    • You may want to some reasonable amount of RAM to use. In "VM Parameters" type: "-Xmx1g" to use 1GB of RAM
    • Select working directory as: "$MODULE_DIR$/sandbox". This is very important, otherwise ImageJ will not find plugins that will be created by Ant.
    • In the box "Before lunch" select checkbox "Run Ant target"
    • Click on "..." next to "Run Ant target" and select target named setup-plugins
    • Click "OK" to close "Run/Debug Configurations" dialog

Now you should be able to run ImageJ with this module's plugins. Click on the green triangle "Run" button. First the sources will be compiled. Next Ant will create module JAR and copy it to sandbox/plugins. Then ImageJ will start. You can also use "Debug" button to start in debug mode.