From Van Essen Lab

Jump to: navigation, search


Development Tools Used for Caret6 Development

Install tools in the order in which they are listed. If you already have a current installation of the JDK, Eclipse, and Mercurial, then you can skip to part 2 of this quick start.


Java 6 is required for Caret6.

Java is pre-installed on Macs. Use Software update to check for new versions. Windows and Linux users should download Java from


Mercurial is used for source code control. Download from and install so that "hg" is in the user's path.

  • Read the Mercurial book.
  • Mercurial and Eclipse example.

In your home directory, create the file ".hgrc" and add the following text to it (with your name and email address):

username =  FirstName LastName  Email-Address

With mercurial, there is a directory ".hg" which is created by Mercurial in the root directory of the project. In addition, uses may create a file in the root directory (same directory as ".hg") name ".hgignore". By default, Mercurial considers all files anywhere in and under the root directory as candidates for version control. ".hgignore" tells Mercurial which files should be ignored by Mercurial and are not candidates for source control. Examples of undesired files are object files and executables.

Mercurial is a distributed version control systems (DVCS). With Caret source code, there is "central" repository. Developers will clone this central repository, make source changes, commit the changes to their cloned repositories, pull updates made by others from the central repository, and push their changes to the central repository. The "hg" command may be executed anywhere in the projects directory tree.


Eclipse is an integrated development environment (IDE).

To install eclipse, download Eclipse IDE for Java Developers from and unzip in the desired directory (/Applications on Mac). Find the executable and draw to Finder (Mac) or set PATH environment variable.

Install FindBugs

  • Select Help->Install New Software and enter Install it. Run it from the projects context menu (run from menu when project is right-clicked).

Creating a Caret6 Development Environment

Get the Source Code and Other Required Files

  • Create a new directory named "caret6_development" and change into the new directory.
  • Get the Caret6 Source code by running one of the following commands:
    • hg clone <path-to-hippocampus>/DS4600/REPOSITORIES_SOURCE_CODE/caret6/caret6_source ./caret6_source
    • hg clone ssh:// ./caret6_source
  • Copy the file "<path-to-hippocamps>/DS4600/REPOSITORIES_SOURCE_CODE/caret6/" to the directory that contains "caret6_source".
  • Unzip the

The current directory should now have three subdirectories.

  • caret6_source contains the source code.
  • caret6lib contains java libraries used by Caret6.

Start and Setup Eclipse

  • Start Eclipse.
  • When asked for a "Workspace", choose a workspace location, it is recommended that you don't use your caret6 checkout directory.

Import Eclipse Projects:

  • In Eclipse, select File Menu->Import
    • In the Import dialog:
    1. Double-Click General
    2. Select 'Existing Projects into Workspace'
    3. Press the Next button.
    4. Ensure that 'Select Root Directory' is selected
    5. Click Browse...
    6. Navigate to the caret6_source directory created above
    7. Press the Ok button.
  • You should now see the following projects selected in the 'Projects:' view:

brain, commandline, common, desktop, files, giftijlib, gui, statisticalalgorithm, statistics, web, wuswing

  • Press the Finish button

Add the path to CARET6LIB:

  • Right-click on the desktop project in Package Explorer and click 'properties'
    • In the Properties for desktop dialog:
    1. Select 'Java Build Path'
    2. Click on the 'Libraries tab'
    3. Select CARET6LIB
    4. Click 'Edit...'
    5. Click 'Variable...'
    6. Click 'New...'
    7. In the 'Name:' textbox, enter CARET6LIB
    8. Click Folder...
    9. Navigate to the caret6lib folder created above, and select the folder containing the libraries for your operating system (i.e. linux-amd64, linux-i586, windows-i586, etc.)
    10. Click 'Ok'
    11. Click 'Ok'
    12. Click 'Ok'
    13. Answer 'Yes' when it asks you to do a full build now.
    14. Congratulations, you've successfully built Caret6! Next we'll add a few settings to launch Caret within eclipse
    15. Click 'Ok'
    16. Keep the 'Properties for desktop' dialog open to configure caret for launch within eclipse

Configure the Caret Application Launcher:

  • In the 'Properties for desktop' dialog:
    1. Select 'Run/Debug Settings in the Properties for desktop dialog
    2. Click 'New...'
    3. Select 'Java Application'
    4. Click 'Ok'
    5. Select the 'Main' tab if it isn't already highlighted
    6. Click 'Search...'
    7. Make sure that 'DesktopCaret - edu.wustl.caret.desktop' is highlighted
    8. Click 'Ok'
    9. Select the 'Environment' tab
    10. Click 'New...'
    11. In the 'Name' textbox, If on Max OSX, enter DYLD_LIBRARY_PATH. If on Windows, enter PATH. If on Linux, enter LD_LIBRARY_PATH
    12. Enter the path to your caret6 libraries. Note that this should be the exact same path that you used for CARET6LIB above.
    13. Click 'Ok'
    14. Click the 'Arguments' tab.
    15. In the VM Arguments section, add "-Xmx2g -Dsun.awt.noerasebackground=true".
    16. Click 'Ok'
  • Click 'Ok'
  • You should now have a working Caret6 development environment. To launch select the project (desktop) in the Package Explorer window and press F11 (Debug) or Ctrl+F11 (Run).

Additional Eclipse Configuration

  • Select Preferences from File Menu (Eclipse Menu on Mac OSX).
  • Select General->Workspace.
    • Check Save Automatically Before Build.
  • Select General->Editors->Text Editors.
    • Check Insert Spaces for Tabs.
    • Check SHow Line Numbers.
  • Select Java->Code Style->Code Templates.
    • Select Comments->Files. Press the Edit button and enter the text with copyright as shown below.
    • Near the bottom of the dialog, select the checkbox next to Automatically Add Comments fro New Methods and Types.
  • Select Java->Editor->Folding.
    • Deselect Enable Folding.
  • Select Java->Code Style->Organize Imports. Press the New button and enter "edu".
  • Select Java->Compiler->Errors/Warnings.
    • Open Potential Programming Problems
      • Set Serializable Class without serialVersionUID to Ignore.
      • Set Possible Accidental Boolean Assignment to Warning.
      • Set Switch Case Fall Through to Warning.
      • Set Null Pointer Access to Warning.
  • Select Java->Installed JREs.
    • Check JVM1.6.0 (or newest) and deselect all others.
  • Select Java->Installed JREs->Execution Environment.
    • In the left section, select JavaSE-1.6. In the right section check JVM 1.6.0 and uncheck all others.
  • Select Java->Code Style->Formatter.
    • Press the Edit.. button in top right.
    • Select the Indentation tab. Remove "[built it]" from Profile Name.
    • Set Tab Policy to Spaces Only and set both tab size and indentation size to 4.
    • Do this for both the Java Conventions and Eclipse Conventions.
  • Press the OK button to close the preferences dialog. Answer No to Full Build pop-up.
  * Copyright 1995-2010 Washington University School of Medicine.
  * CARET is free software
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * GNU General Public License for more details.
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <>.
Personal tools
Sums Database