Difference between revisions of "Downloading and Building Fiji From Source"

(Building Fiji from Source)
(move "Adding plugins" to a new page.)
Line 42: Line 42:
[[Image:Fiji-main-window.png|Fiji's main window]]
[[Image:Fiji-main-window.png|Fiji's main window]]
== Adding plugins ==
After you built Fiji successfully, you can add your own plugins.
* If you haven't done so, pick a name for your .jar file, say ''My_Plugin''.  Make sure that it has at least one underscore in it, otherwise ImageJ will not pick it up.  If you cannot think of a name with an underscore, just append one.  Then create a subdirectory ''src-plugins/My_Plugin''.
* Now put your sources into that subdirectory.  Please no .class files.  Readme or license files are okay, however.
* Create a ''staged-plugins/My_Plugin.config'' file.  This will be included in the .jar file as ''plugins.config''.
* In Fiji's root folder, call '''./fiji scripts/commit-plugin.py src-plugins/My_Plugin/'''.  Please make sure that it ends with a slash.  This command will make the necessary edits to the Fakefile and .gitignore, and commit everything needed for your plugin.
* Now build the plugin with '''./fiji --fake'''.
* After testing, you might realize that you need changes.  In this case, decide if you want to amend the commit (if there was a silly typo, you might want to hide that fact from the world), or if you want to make a new commit.
* When everything is done and fine, publish!

Revision as of 07:51, 1 October 2008

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. If you are not familiar with Git, you might want to read this page or these pages instead.

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

git clone git://pacific.mpi-cbg.de/fiji.git

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.


This will not yet be complete tree that you can build, since the fiji repository has on a number of submodules. (For more on submodules, see the Git submodule tutorial.) If you have lots of disk space available, these submodules can be initialized with:

git submodule init ImageJA TrakEM2 VIB micromanager1.1 mpicbg

... but if you are short of disk space you may skip that step. However, if you do not have Java 1.5 or newer installed, you need to initialize at least the java submodule for your platform by doing, depending on your system:

git submodule init java/linux          # For 32-bit Linux systems
git submodule init java/linux-amd64    # For 64-bit Linux systems
git submodule init java/macosx-java3d  # For MacOS X systems
git submodule init java/win32          # For 32-bit Windows systems
git submodule init java/win64          # For 64-bit Windows systems

You can then update the submodules with:

git submodule update

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 Fake.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