Skip to content
Curtis Rueden edited this page May 21, 2015 · 3 revisions

One powerful way to debug ImageJ-OMERO functionality is via remote debugging.

Steps

  1. Build the imagej-omero project (E.g., on the CLI: mvn).
  2. Copy or symlink the target/imagej-omero-x.y.z.jar file into your ImageJ installation.
  3. Import the imagej-omero project into your IDE. (E.g., in Eclipse: File > Import > Existing Maven Project.)
  4. Launch ImageJ with --debugger=8000,suspend=y flag. This enables attaching a debugging session from your IDE.
  5. Optionally, set any needed breakpoints in the ImageJ-OMERO code. Good entry points are the commands in the net.imagej.ops.commands package.
  6. Connect your IDE to the session using port 8000. (E.g., in Eclipse: Run > Debug Configurations, scroll to bottom of lefthand pane, right-click "Remote Java Application" and choose New. Select imagej-omero as the project.)
  7. Once connected, ImageJ will start up.
  8. Step away!

Debugging ImageJ scripts on the OMERO server side

If you are running ImageJ scripts from the OMERO server, you can use remote debugging to troubleshoot that, too:

  1. Edit your ImageJ installation's lib/run-class script, adding --debugger=8000,suspend=y after --headless in the "Launch ImageJ" section at the bottom.
  2. Launch the script as usual (e.g., from the CLI: omero script launch 1234).
  3. Connect your IDE to the Java process which gets spawned, as described above.
  4. Inspect all the things!

Pitfalls

  • Line numbers will only make sense if the versions of all involved libraries match between your ImageJ installation and the Maven dependencies in your imagej-omero project. If things do not match, you can tweak them in your IDE by editing the pom.xml file and changing them yourself by setting the relevant version properties—e.g., add <properties><scifio.version>0.23.0</scifio.version></properties> if your ImageJ has scifio-0.23.0.jar in its jars folder.

See also

Clone this wiki locally