-
Notifications
You must be signed in to change notification settings - Fork 10
Debugging
Curtis Rueden edited this page May 21, 2015
·
3 revisions
One powerful way to debug ImageJ-OMERO functionality is via remote debugging.
- Build the imagej-omero project (E.g., on the CLI:
mvn
). - Copy or symlink the
target/imagej-omero-x.y.z.jar
file into your ImageJ installation. - Import the imagej-omero project into your IDE. (E.g., in Eclipse: File > Import > Existing Maven Project.)
- Launch ImageJ with
--debugger=8000,suspend=y
flag. This enables attaching a debugging session from your IDE. - Optionally, set any needed breakpoints in the ImageJ-OMERO code. Good entry points are the commands in the
net.imagej.ops.commands
package. - 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.)
- Once connected, ImageJ will start up.
- Step away!
If you are running ImageJ scripts from the OMERO server, you can use remote debugging to troubleshoot that, too:
- Edit your ImageJ installation's
lib/run-class
script, adding--debugger=8000,suspend=y
after--headless
in the "Launch ImageJ" section at the bottom. - Launch the script as usual (e.g., from the CLI:
omero script launch 1234
). - Connect your IDE to the Java process which gets spawned, as described above.
- Inspect all the things!
- 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 hasscifio-0.23.0.jar
in itsjars
folder.
- Attaching to ImageJ instances section of ImageJ's debugging guide