== 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 [http://git.or.cz/ git] (Windows users, please go [http://msysgit.googlecode.com here]). If you are not familiar with Git, you might want to read [[Git mini howto|this page]] or [[:Category:Git|these pages]] instead.
==== Cloning source as unknown contributor ==== Your first step should be to "clone" the fiji repository with the following command:
git clone email@example.com:/srv/git/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.
'''If this clone is slow''', you might want to try to clone from github.com, and after that switch back to the official repository:
git clone git://github. com/fiji/fiji cd fiji git config remote. origin.url git://fiji.sc/fiji.git git pull
If you are getting errors like this:
github. com[0: 18.104.22.168]: 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. [ http://en.wikipedia. org/wiki/Phrases_from_The_Hitchhiker's_Guide_to_the_Galaxy Do not panic], though, you might be able to clone the repository with
git clone firstname.lastname@example.org:/srv/git/fiji.git
git clone https:// email@example.com/fiji/ fiji. git
.. where you should replace < tt> yourusername</ tt> 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 fiji.sc, then you should clone fiji with the following command: git clone ''firstname.lastname@example.org: /srv/git/fiji.git
Just substitute ''username'' with your corresponding user name on that machine.
=== Submodules ===
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 <tt>ImageJA</ tt>, <tt>TrakEM2</ tt> and <tt>mpicbg</ tt> submodules, you should initialize and update them with the following commands:
git submodule init modules/ImageJA modules/TrakEM2 modules/mpicbg git submodule update
Note:''' in the common case, you do not need <u>any</u> submodule to be checked out (except the Java submodule, which will be checked out automatically once you run the [[Fiji Build System|Fiji Build]] with: ./ Build.sh Note: using <b>git submodule update</b> without specifying which submodule, will update <b>all</b> submodules. What <i>update</i> 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 <b>(no branch)</b> situation. To fix it, just cd to that submodule <i>git checkout master</i> 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 ./configure-submodule.py TrakEM2 === Getting a snapshot without Git === If you insist on not using Git, you can download a snapshot of Fiji [http://fiji.sc/cgi-bin/gitweb.cgi?p=fiji.git;a=snapshot;h=master;sf=tgz 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 Build.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: [[Image:Fiji- main-window.png|Fiji's main window]] === Multi-platform build confirmed successes === Typically, multi-platform is plain hell. As today (June 2012), [[User:Schindelin|Johannes Schindelin]] put enough effort to ensure that Fiji builds '''at the very least''' on the following systems: * Linux * Windows 64-bit with [http://msysgit. github.com/ MSysGit] * Windows 64-bit using [http://www.cygwin.com/ Cygwin] * MacOS X 10.5 (Leopard) * MacOS X 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: <code lang="bash"> unset JAVA_HOME </code>