Downloading and Building Fiji From Source

Revision as of 07:24, 16 September 2010 by Pthevena (talk | contribs) (Cloning source as unknown contributor: Suggest using the 'contrib' URL)

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

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.) These submodules must be initialized and updated with the following commands:

git submodule init ImageJA TrakEM2 VIB micromanager1.1 mpicbg
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