Using maven to deploy directly to a Fiji installation

This is extremely useful just before you want to upload your plugin(s) to your/a update site. If this really is you use case, you might want to check that the parent POM version you are using coincides with the one of the latest Fiji release!

The command for this is:

mvn -Dimagej.app.directory=/Applications/Fiji.app/ -Ddelete.other.versions=true clean install

And in case the enforcer annoys you — it can be turned off like this:

mvn -Dimagej.app.directory=/Applications/Fiji.app/ -Ddelete.other.versions=true -Denforcer.skip=true clean install

Enjoy,
Florian

Trouble saving KNIME workflow after >3 days without saving?

Recently we ran a very intense training procedure from within a KNIME workflow. The whole thing ran for roughly 4 days.

Finally terminated we ran into troubles saving the workflow, getting some ‘File access problems: /var/folders… etc. etc’ error dialog.

Turns out that Java cleans up its temp folder after 3 days or so (on MacOS at least). In doing so KNIME ended up having the open workflow being corrupted.

Way out: before starting such a monstrous run you might want to configure KNIME to use another temp folder… one that Java does not wipe out every now and then.

  • In KNIME open via menu: KNIME – Preferences
  • Then choose ‘KNIME’ on the left side, and
  • enter a folder name of your choice in the text field with the label ‘Directory for temporary files’.
  • Restart KNIME – done!

Change the Fiji temp Folder (by passing JVM arguments)

Why? For example if you run Fiji headless on a cluster and you would like it to use a fast local folder instead of a network drive.

This page tells you how you can pass on JVM arguments to Fiji upon start: http://fiji.sc/Java_Options

One can specify the “temp” directory using the following command:

$ fiji -Djava.io.tmpdir=~/tmp -- &

Double dash at the end is required to specify that the given argument is for Java.

Find JAR Containing Specific Class

Tons of JARs are in the classpath of Fiji. Multiple JARs might contain the same class definition.

In order to know which JAR is the one hosting the version Fiji is actually using (this is determined by the order those JARs are found in the CLASSPATH), you can use this handy function from within Fiji.

Start Fiji – hit ctrl+L or cmd+L on your keyboard – type ‘jar’ in the search field – start ‘Find jar for class’ and type the name of the class + the entire package information as shown below – hit ‘Ok’ – done!

Fiji_findJarForClass