User Tools

Site Tools


documents:100825imagej_eclipse_debugging

This is an old revision of the document!


Setting Up Eclipse Debugging Environment for ImageJ Plugin Development

Eclipse IDE is an extremely useful IDE but very complicated on first look (and on second, third… for me). Setting environment is important for efficient development but this preparation actually is not so straight forward. Some step-by-step instructions are available here or here.
Following these instructions does enable you to develop nicely. With these instructions, you could probably understand how to set classpath and how to link other projects as reference.

For myself, it has always been the most difficult configuration to set debug and run environment. After some experiences, I found that setting Run/Debug environment is very flexible and many ways: too flexible that it is difficult for beginners to get some first grip on setting them successfully.

I expose one of my debug/run setting of ImageJ plugin development in Eclipse. Note that this is not the only way, and the most important setting is “Arguments”. This run configuration assumes that the compiled plugin (e.g. jar file) is already copied to the plugin folder of ImageJ or Fiji plugin folder.

Main tab

Run/Debug configuration is done via [Run → Run Configurations…] from the menu. You will see a panel, with left column listing your Run setups and in the right several tabbed panels for setting parameters. Here is the “Main” tab.

Run Configuration tab “Main”

In Project field, select the ImageJ plugin project that you want to debug or run. In Main class field, set ij.ImageJ as the main class. This causes Run to start up ImageJ. If you type fiji.Main, then Fiji will start up. For these classes to be recognizable by Eclipse, you could set your working directory to ImageJ folder (see the next tab “Arguments” explanation) or Fiji folder, or set class path explicitly to corresponding jar file. In case of ImageJ alone, ij.jar is the target.

There are three check boxes below these fields. I never touched them before to check. If you have problem in setting up Fiji main class, checking both “Include…” check boxes ON might help.

Arguments tab

Run Configuration tab "Arguments" Run Configuration tab "JRE" Run Configuration tab "Classpath" Run Configuration tab "Source"

documents/100825imagej_eclipse_debugging.1314791200.txt.gz · Last modified: 2016/05/24 12:46 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki