Downloading and Building Fiji From Source

Revision as of 10:29, 10 July 2014 by Rueden (talk | contribs) (Use Warning te)
Revision as of 10:29, 10 July 2014 by Rueden (talk | contribs) (Use Warning te)


Downloading the Source Code with Git

Warning: the source code for Fiji is rather large; make sure that you have two gigabytes of disk space free before beginning this.

To fetch the Fiji source code you should use git (Windows users, please go here). If you are not familiar with Git, you might want to read this page or these pages instead.

Cloning source as unknown contributor

Your first step should be to "clone" the fiji repository with the following command:

git clone

This should start downloading the base fiji repository and unpack it into a directory called "fiji" in your current directory. Once this has successfully completed, change into the newly created "fiji" directory.

If this clone is slow, you might want to try to clone from, and after that switch back to the official repository:

git clone git://
cd fiji
git config remote.origin.url git://
git pull

If you are getting errors like this:[0:]: errno=Connection timed out fatal: 
unable to connect a socket (Connection timed out)

then you probably are behind a firewall that does not let you connect to port 9418. Do not panic, though, you might be able to clone the repository with

git clone


git clone

... where you should replace yourusername with your GitHub username.

Cloning source as known contributor

The above command creates a unknown contributor copy of Fiji in your computer. If you have your own user account in, then you should clone fiji with the following command:

git clone

Just substitute username with your corresponding user name on that machine.


Some plugins are managed as submodules. If you want to work on them, you will have to initialize and update them. (For more on submodules, see the Git submodule tutorial.) For example, if you know that you're going to need to work on the ImageJA, TrakEM2 and mpicbg submodules, you should initialize and update them with the following commands:

git submodule init modules/ImageJA modules/TrakEM2 modules/mpicbg modules/imglib
git submodule update

Note: in the common case, you do not need any submodule to be checked out (except the Java submodule, which will be checked out automatically once you run the Fiji Build with:


Note: using git submodule update without specifying which submodule, will update all submodules. What update means: "put all submodules, if checked out, to the last commit that was committed in the fiji repos". Which is most likely not what you want--will put any submodule that you have been working on into a (no branch) situation. To fix it, just cd to that submodule git checkout master or whatever branch you were working on.

Alternately, if you want to automatically clone, configure and/or update a submodule with all its dependent submodules, you can run (e.g., for TrakEM2):

cd bin
./ TrakEM2

Getting a snapshot without Git

If you insist on not using Git, you can download a snapshot of Fiji here, but you need to make sure that you have a new enough Java version installed.

Building Fiji from Source

You should now be able to build Fiji with:

sh run

... which will invoke Fiji's multi-platform build system. If all goes well, after some time you should see the main Fiji window:

Fiji's main window

Multi-platform build confirmed successes

Typically, multi-platform is plain hell. As of June 2012, Johannes Schindelin put enough effort to ensure that Fiji builds at the very least on the following systems:

  • Windows 64-bit with MSysGit
  • Windows 64-bit using Cygwin (you will need at least the curl & unzip functions to be installed)
  • MacOSX 10.5 (Leopard)
  • MacOSX 10.6 (Snow Leopard)
  • MacOSX 10.7 (Lion)

Missing Java3D

During the build process there might be complaints about missing Java3D features if you already have a Java SDK installed. To force the build system to clone a JDK with everything needed by Fiji (including Java3D support) you need to clear the environment variable JAVA_HOME before building: