Skip to content, Skip to search


Downloading and Building Fiji From Source

2,617 bytes added, 09:15, 9 July 2019
Add step about installing OpenJDK 8
== Downloading {{FijiMenu}}The complete Fiji distribution of ImageJ consists of over a hundred individual components. Most of these components are ImageJ [[plugins]]; the Source Code with Git ==rest are core libraries, [[scripts]] and several other resources (such as the [[:File:Fiji-icon.png|Fiji logo]] and the README).
''Warning: In the past, Fiji used to be built from one monolithic source code for repository, which became unmanageable over time. These days, therefore, developers start from a fully-populated ''Fiji is rather large; make sure that you have two gigabytes of disk space free before beginning''directory and build only the parts they would like to change.
To fetch the = Download Fiji source code you should use [ git]. If you are not familiar with Git, you might want to read [[Git mini howto|this page]] or [[:Category:Git|these pages]] instead.=
Your The first step should be to "clone" is the fiji repository with same for developers as it is for users: [[Downloads|Download]] Fiji, and unpack it. The Desktop is the following command:recommended location.
git clone git:// Install Java =
This should start downloading the base fiji repository and unpack it into The next step is to install [ OpenJDK 8]. You will need a directory called "fiji" JDK in your current directory. Once this has successfully completed, change into the newly created "fiji" directoryorder to develop Java code.
=== Submodules ==Check out and build individual plugins/libraries =
This will not yet be complete tree To develop a plugin, the developer first needs to find out in which file it is contained. To do that you can build, since simply call the fiji repository has on a number of submodules. ''Command Finder'' (For more on submodulesshortcut {{key press|Ctrl|L}}), see type (part of) the [[Git submodule tutorial]].) If label of the menu entry in whose function you have lots of disk space availableare interested, these submodules can be initialized with:and look at the ''File'' column.
git submodule init ImageJA TrakEM2 VIB micromanager1Each individual component is maintained in its own repository in the [ ''fiji'' org on GitHub]. The name of the repository corresponding to a given ''.jar'' file is essentially identical with the file name, except that trailing underscores are stripped. Example: ''Stitching_.jar'' is maintained in the repository at, ''Time_Lapse.jar'' in the repository at mpicbg
... but if you are short If in doubt about the location of disk space you may skip that step. Howeverthe repository, if you do not have Java 1.5 or newer installed, you need just call {{bc | Plugins | Debug | System Information}} and find the section corresponding to initialize at least the java submodule for your platform by doing, depending on your system:file in question.
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 systemsOnce the developer has identified which plugin or library she wants to modify or develop further, it is very easy to build and contribute by following [[How to contribute to an existing plugin or library|this tutorial]].
You can then update the submodules with:== Example ==
git submodule updateLet's assume that we want to develop the Skeletonize3D plugin. Its source code is maintained at The first step is to clone the source code:
<source lang=== Getting a snapshot without Git ==="bash">$ git clone into 'Skeletonize3D'...remote: Counting objects: 115, done.remote: Compressing objects: 100% (58/58), done.remote: Total 115 (delta 46), reused 115 (delta 46)Receiving objects: 100% (115/115), 22.81 KiB | 0 bytes/s, done.Resolving deltas: 100% (46/46), done.Checking connectivity... done.</source>
If you insist on not using GitYou only need to type the part after the ''$'' prompt, i.e you can download a snapshot of Fiji [httpwould type <code>git clone https://pacificgithub.mpi-cbg.decom/fiji/cgi-binSkeletonize3D</gitwebcode>.cgi?p=fiji.git;a=snapshot;h=master;sf=tgz here]The rest is shown only for reference, but so that you need know what to make sure that you have a new enough Java version installedexpect.
== Building Fiji from Source==Then let's use the command-line Maven to build the project:
You should now be able to build Fiji with<source lang="bash">$ cd Skeletonize3D/$ mvn[INFO] Scanning for projects...[... lots and lots of interesting and useful information ...][INFO] ------------------------------------------------------------------------[INFO] BUILD SUCCESS[INFO] ------------------------------------------------------------------------[INFO] Total time:52.574s[INFO] Finished at: Tue Dec 02 10:27:00 CET 2014[INFO] Final Memory: 20M/81M[INFO] ------------------------------------------------------------------------</source>
sh FakeAnd finally, let's build the project and install it into the '' runapp/'' directory:
<source lang="bash">$ mvn$HOME/Desktop/ -Ddelete.other.versions=true[INFO] Scanning for projects...[... lots and lots of interesting and useful information ...][INFO][INFO] --- imagej-maven-plugin:0.5.4:copy-jars (copy-jars) @ Skeletonize3D_ ---[INFO] Copying Skeletonize3D_-1.0.2-SNAPSHOT. which will invoke jar to $HOME/Desktop/Fiji's[INFO] Deleted overridden Skeletonize3D_-platform build system1. If all goes well, after some 0.1.jar[INFO] Copying ij-1.49j.jar to $HOME/Desktop/[INFO] Deleted overridden ij-1.49m.jar[INFO] ------------------------------------------------------------------------[INFO] BUILD SUCCESS[INFO] ------------------------------------------------------------------------[INFO] Total time you should see the main Fiji window:21.331s[INFO] Finished at: Tue Dec 02 10:30:02 CET 2014[INFO] Final Memory: 14M/81M[INFO] ------------------------------------------------------------------------</source>
[[Image:Of course, this assumes that you followed the suggestion and unpacked your Fiji onto the Desktop. If you unpacked it somewhere else, you ''have'' to adjust the command-line accordingly. Note that the exact dependency versions, as specified by the project in the ''pom.xml'' file, are copied into the '''' directory, possibly replacing other versions. You will want to make sure to use not-maintoo-windowdifferent versions from the current versions.png| [[Category:Development]][[Category:Fiji's main window]]
Bureaucrat, emailconfirmed, incoming, administrator, uploaders