How to run FiJi at Raspberry Pi 3

Hi all,

I’ve decided to write a new post after trying (without success) to install and run FiJi at Raspberry Pi. The below link was my first guide:

It didn’t work, so i’ve started from zero.


  1. Download 64 bits Linux from
  2. Check Java 8 is installed at Rasberry Pi

Next steps?
How can we run Fiji from command line (–headless)?

I’m afraid that there’s not enough information abour this topic. Thanks in advance!

1 Like

Dear @legramo,

could you take a look at and see if that helps with your issues? There are some rough edges around the headless mode, if you depend on ImageJ1.

Will you require a user interface for what you want to do?


1 Like

Dear @strelfrich,

Thanks for your response. As far as i don’t the need the user interface, i’d like to execute fiji from command line. The goal is to obtain the NDVI factor after processing some images token from the RPi camera. I’ve already achieved this goal using Windows + Fiji + PhotoManager Plugin, but i don’t know how to solve it using a raspberry pi.

The first step is to run FiJi at the RPi, and i’m not even able to do it from the command line…

First of all, did i download the FiJi’s right version (with Java 8)? How can i run it? Thanks!

./ImageJ-linux64 --ij2 --headless
bash: ./ImageJ-linux64 cannot execute binary file: Exec format error

Download the No JRE Fiji and install Java 8 on your Raspberry Pi. Then, head over to the thread that you have already linked to:

Curtis posted a link to a script that you can use instead of the ImageJ-linux64 binary if you have downloaded a Fiji without a bundled JVM:

$ wget
$ chmod u+x
$ /bin/bash --headless

Don’t have access to my RPi at the moment, so you’ll have to check if it works.

1 Like

I started a Raspberry Pi wiki page, based on information from the linked forum thread. The ImageJ web site is a wiki, so please flesh it out if you have additional tips, needed steps, etc.


I don’t have one of these for testing, but do have a Jetson TX1 that has a 64-bit ARM processor like the RP3. I tried building the native launcher but found that the maven native compiler plugin doesn’t support ARM64. does work, but note that the Oracle version of Java 8 is headless only so you’ll have to use OpenJDK’s version. With the Oracle version will start but eventually quit without ever loading the GUI (the error output is suppressed).

So you do have a screen attached / X11 running and are looking to get Fiji running with a user interface?

Sure, i will flesh it out the wiki once the RPi is working fine :slight_smile:

This is the current situation. FiJi GUI works fine (but not headless) at Raspberry Pi 3 if you follow the next steps:

  1. Install Java 8
    How to
  2. Use this FiJi version
  3. Use this script in order to run Fiji
    $ wget
    $ chmod u+x
    $ /bin/bash

BUT, it doesn’t work headless from command line…

root@raspberrypi:/home/pi/ /bin/bash --headless
Java HotSpot(TM) Client VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
java.lang.IllegalArgumentException: Cannot handle app name in ij.gui.YesNoCancelDialog's public <init>(java.awt.Frame parent, java.lang.String title, java.lang.String msg)
	at net.imagej.patcher.CodeHacker.replaceAppNameInCall(
	at net.imagej.patcher.LegacyExtensions.insertAppNameHooks(
	at net.imagej.patcher.LegacyExtensions.injectHooks(
	at net.imagej.patcher.LegacyInjector.inject(
	at net.imagej.patcher.LegacyInjector.injectHooks(
	at net.imagej.patcher.LegacyEnvironment.initialize(
	at net.imagej.patcher.LegacyEnvironment.applyPatches(
	at net.imagej.patcher.LegacyInjector.preinit(
	at net.imagej.patcher.LegacyInjector.preinit(
	at net.imagej.legacy.LegacyService.<clinit>(
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
	at java.lang.reflect.Constructor.newInstance(
	at java.lang.Class.newInstance(
	at org.scijava.service.ServiceHelper.createServiceRecursively(
	at org.scijava.service.ServiceHelper.createExactService(
	at org.scijava.service.ServiceHelper.loadService(
	at org.scijava.service.ServiceHelper.createServiceRecursively(
	at org.scijava.service.ServiceHelper.createExactService(
	at org.scijava.service.ServiceHelper.loadService(
	at org.scijava.service.ServiceHelper.loadService(
	at org.scijava.service.ServiceHelper.loadServices(
	at org.scijava.Context.<init>(
	at org.scijava.Context.<init>(
	at org.scijava.Context.<init>(
	at org.scijava.Context.<init>(
	at net.imagej.ImageJ.<init>(
	at net.imagej.Main.launch(
	at net.imagej.Main.main(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at net.imagej.launcher.ClassLauncher.launch(
	at net.imagej.launcher.ClassLauncher.main(
Caused by: javassist.CannotCompileException: No code replaced!
	at net.imagej.patcher.CodeHacker$EagerExprEditor.instrument(
	at net.imagej.patcher.CodeHacker.replaceAppNameInCall(
	... 36 more

Any suggestions? Thanks in advance

1 Like

I think this error is not specific to the Pi, but rather the latest version of ImageJ 1.x. You can try downgrading to an earlier version of ImageJ1 using the command Help :arrow_forward: Update ImageJ…. See also this PR which @stelfrich already filed to address the issue.

To troubleshoot what ImageJ is doing while booting up headless, you can try pressing Ctrl+\ while the console has the keyboard focus, and it should emit a Java thread dump. If you do this several times, you might be able to see where the program is stuck.

1 Like

Thanks for your contribution @ctrueden . Unfortunately i’ve been unable to downgrade imageJ from the updater, would you mind to provide us more details about how to manage it? Thanks

Did you use the Help :arrow_forward: Update ImageJ… command (and not Help :arrow_forward: Update)? It should look similar to this:

1 Like

@imagejan, you were completely right, thanks! After downgrading ImageJ to v1.50 using using the command Help :arrow_forward: Update ImageJ, it seems that --headless works (the fails dissapear):

root@raspberrypi:/home/pi/ /bin/bash --headless
Java HotSpot™ Client VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot™ Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

The next step would be to execute the Photomonitoring plugin as i do from the GUI (open an image, photomonitoring plugin, single image index processing from displayed image, etc…). These are the guides that i’ve deal with:

But the steps are not to clear… could any of you provide us a good example about how to open and process an image with a plugin (photomonitoring if it’s possible) from the command line? Thanks.

Did you read these guides?

If it’s still not clear, please post what you have tried, and what doesn’t work, so we can help improve it.

I do agree that it would be good to offer a simple and clear headless example here. I do not have time to write one myself right now, but perhaps we could converge on one together here.

1 Like

Hi…you can follow the below steps to use Fiji. Install Java 8 on your Pi. Verify it works using java -version from the command line.Download and install the [platform-independent “no JRE” distribution of Fiji]Download the shell script, set its executable bit and run it to launch ImageJ. Note that the shell script supports only a subset of the functionality of the native, but it should be able to run ImageJ successfully.

one-stop pcb

2 posts were split to a new topic: Using webcam with ImageJ on Raspberry Pi

Hello, I have found I am having similar issues with running Fiji headless, I access Raspberry Pi from ssh and I can’t work out how to downgrade my installation to avoid from failing. Any help will be greatly appreciated