1.3. Eclipse IDE (Eclipse 4.5.2 “Mars SR2”) - install and configure

This section describes how to install and configure the Eclipse IDE. See Installing a previously-configured Eclipse if you want to use a pre-configured version.

Instructions are provided for Eclipse 4.5.2 (“Mars SR2”).

1.3.1. Install and configure Eclipse

1.3.1.1. Install Eclipse for RCP and RAP Developers

  1. Download Eclipse 4.5.2 (“Mars SR2”) “Eclipse for RCP and RAP Developers” from http://www.eclipse.org/downloads/.
    (Note: At this stage, use of the Eclipse installer is incompatible with the way we use Buckminster, so don’t use it).
    Use of a 64-bit OS (and 64-bit Java and Eclipse) is strongly recommended. We only support DAWN and GDA on 64-bit, so it makes sense that you develop on that.

    The description below assumes Linux, but the same procedure can be used for Windows.

  2. Unzip the downloaded file:

    download=/dls_sw/dasc/eclipse_IDE_downloads/eclipse-rcp-mars-2-linux-gtk-x86_64.tar.gz
    arch=64
    eversion=452
    unpacked=/scratch/eclipse${eversion}
    mkdir -v ${unpacked}
    tar -zxf ${download} -C ${unpacked}
    today=$(date +"%Y%m%d")
    mv -v ${unpacked}/eclipse ${unpacked}/eclipse${eversion}_linux${arch}_${today}
    
  3. In the unzipped directory, edit eclipse.ini (use gedit ${unpacked}/eclipse${eversion}_linux${arch}_${today}/eclipse.ini & or equivalent):

    Add the following line immediately above -vmargs:

    -showLocation
    

    Add the following line immediately after -vmargs:

    -Dfile.encoding=UTF-8
    

    Change the minimum Java version to 1.8:

    -Dosgi.requiredJavaVersion=1.8
    

    Delete the backup file:

    rm ${unpacked}/eclipse${eversion}_linux${arch}_${today}/eclipse.ini~
    
  4. Start the Eclipse IDE using the following command line options (use a new workspace):

    # Ensure that the correct Java (Java 8) is on the path
    module load java/gdamaster  # at Diamond Light Source
    java -version
    # If you use a network proxy, and are on Linux, ensure environment variables $http_proxy/$https_proxy/$no_proxy are set
    module load global/http_proxy  # at Diamond Light Source
    printenv | grep "_proxy="
    ${unpacked}/eclipse${eversion}_linux${arch}_${today}/eclipse -refresh &
    
  5. At Project, de-select Build automatically

  6. If you need to specify a network proxy, the best way on Linux is to set environment variables $http_proxy/$https_proxy/$no_proxy before starting Eclipse.
    Alternatively, or if you are on Windows, specify the network proxy within Eclipse, at Window ‣ Preferences ‣ General ‣ Network Connections
  7. Run Help ‣ Check for Updates and restart if necessary

Once you have installed Eclipse, you will need to install a number of additional features. Be sure to restart Eclipse when prompted after each install.

1.3.1.2. EGit/JGit (Eclipse IDE Git adapter) update

The version of EGit/JGit bundled with Eclipse Mars SR2 is 4.1.1. Update it to 4.2.0 (or whatever the latest at https://www.eclipse.org/egit/download/ is).

  1. At Window ‣ Preferences ‣ Install/Update ‣ Available Software Sites, enable (adding first if necessary):

    http://download.eclipse.org/egit/updates
    
  2. At Help ‣ Install New software, select the site you just added, and install:

    Eclipse Git Team Provider
       Eclipse Git Team Provider
       Eclipse Git Team Provider - Task focused interface
    JGit
       Java implementation of Git
    

1.3.1.3. Subclipse (Eclipse IDE Subversion adapter)

Note

This addition to the Eclipse IDE is optional, but recommended for developers located at Diamond Light Source (external developers do not require this)

If you need access to source code stored in a Subversion repository, you need to install an Eclipse Subversion adapter.
Subclipse (recommended) and Subversive are mutually exclusive Eclipse Subversion adapters; choose exactly one (this manual assumes you selected Subclipse).
  1. We will install Subclipse 1.10.x, which includes and requires Subversion 1.8.x client (not server) features and working copy format:

    module load subversion/1.8.13  # at Diamond Light Source, if you need a subversion command line client
    
  2. At Window ‣ Preferences ‣ Install/Update ‣ Available Software Sites, enable (adding first if necessary):

    http://subclipse.tigris.org/update_1.10.x
    
  3. At Help ‣ Install New software, select the site you just added, and install:

    Subclipse
       Subclipse (Required)
       Subclipse Client Adapter (Required)
       Subversion JavaHL Native Library Adapter
    SVNKit
       JNA Library
       SVNKit Client Adapter
       SVNKit Library
    
  4. At Window ‣ Preferences ‣ Team ‣ SVN, and under SVN Interface: Client, select an available client.
    SVNKit is the most portable, so if you a creating a shared install, that’s probably the most appropriate. It can be changed later if required.
    Whichever client you select, be sure to read the notes on Subversion security.

1.3.1.4. Buckminster

Note

This addition to the Eclipse IDE is REQUIRED for Dawn and GDA development

Buckminster is required for materializing and building, so you need to install it, and its Git and (optionally) Subversion support.
Install at most one of Buckminster Subclipse and Subversive support, matching the Eclipse Subversion adapter you installed previously.
  1. At Window ‣ Preferences ‣ Install/Update ‣ Available Software Sites, enable (adding first if necessary):

    http://download.eclipse.org/tools/buckminster/updates-4.5
    
  2. At Help ‣ Install New software, select the site you just enabled, and install:

    Buckminster
       Buckminster - Core
       Buckminster - Git Support
       Buckminster - Maven Support
       Buckminster - PDE support
    Buckminster SVN Support (Subclipse)
       Buckminster - Subclipse support  # optional, only select if you installed Subclipse in the previous step
    

1.3.1.5. PyDev

Note

This addition to the Eclipse IDE is optional, but recommended for Dawn and GDA development

PyDev is recommended for development work with Python and Jython.

  1. At Help ‣ Eclipse Marketplace, find “PyDev” and install these items:

    PyDev - Python IDE for Eclipse
       PyDev for Eclipse
    

1.3.1.6. Spring IDE

Note

This addition to the Eclipse IDE is optional, but recommended for GDA development

Spring IDE is recommended for development work with Spring configurations. The Spring IDE is a a subset of the larger Spring Tool Suite.

  1. At Help ‣ Eclipse Marketplace, find “Spring IDE Eclipse 3.7.3.RELEASE” and install the required components

1.3.1.7. FindBugs

Note

This addition to the Eclipse IDE is optional, but recommended for Dawn and GDA development

FindBugs uses static analysis to look for bugs in Java code.

  1. At Window ‣ Preferences ‣ Install/Update ‣ Available Software Sites, enable (adding first if necessary):

    http://findbugs.cs.umd.edu/eclipse/
    
  2. At Help ‣ Install New software, select the site you just enabled, and install:

    FindBugs
       FindBugs feature
    

1.3.1.8. ObjectAid UML Explorer

Note

This addition to the Eclipse IDE is optional, but recommended for Dawn and GDA development

ObjectAid UML Explorer is a code visualization tool for the Eclipse IDE.

  1. At Window ‣ Preferences ‣ Install/Update ‣ Available Software Sites, enable (adding first if necessary):

    http://www.objectaid.net/update
    
  2. At Help ‣ Install New software, select the site you just enabled, and install:

    ObjectAid UML Explorer
       ObjectAid Class Diagram
    

1.3.1.9. vogella e4 tools

Note

This addition to the Eclipse IDE is optional, but is being trialled to see if it is useful for Dawn and GDA development

vogella e4 tools provides e4 tools for Eclipse RCP development.

  1. At Window ‣ Preferences ‣ Install/Update ‣ Available Software Sites, enable (adding first if necessary):

    https://dl.bintray.com/vogellacompany/e4tools-mars
    
  2. At Help ‣ Install New software, select the site you just enabled, and install all available items

1.3.1.10. Gonsole

Note

This addition to the Eclipse IDE is optional, but is being trialled to see if it is useful for Dawn and GDA development

Gonsole provides a Git Console for the Eclipse IDE

  1. At Window ‣ Preferences ‣ Install/Update ‣ Available Software Sites, enable (adding first if necessary):

    https://rherrmann.github.io/gonsole/repository/
    
  2. At Help ‣ Install New software, select the site you just enabled, and install:

    Gonsole - Git Console for Eclipse
       Gonsole - EGit Integration
       Gonsole - Git Console for Eclipse
    

1.3.2. Publish the Eclipse IDE

Note: This step only needs to be done by the build engineer.

You should install and configure the Eclipse IDE for both Linux (64-bit) and Windows (64-bit).

Once you have installed and configured the Eclipse IDE, zip it and copy to a shared network drive, so that developers can take a local copy.

  1. Restart the IDE with the -clean option:

    ${unpacked}/eclipse${eversion}_linux${arch}_${today}/eclipse -clean -refresh &
    
  2. At Window ‣ Preferences ‣ General ‣ Startup and Shutdown ‣ Workspaces

    Remove all recent workspaces
    Change Number of recent workspaces to remember to 10
  1. tar/zip the distribution:

    # environment variables that are probably already defined
    arch=64
    eversion=452
    unpacked=/scratch/eclipse${eversion}/
    today=$(date +"%Y%m%d")
    # check environment and publish
    echo "eversion=${eversion} unpacked=${unpacked} arch=${arch} today=${today}"
    packed=/scratch/eclipse${eversion}_linux${arch}_${today}.tar.gz
    cd ${unpacked}/
    find eclipse${eversion}_linux${arch}_${today}/ -name ".keyring" -print -delete
    tar -zcf ${packed} eclipse${eversion}_linux${arch}_${today}/
    cp -pvi ${packed} /dls_sw/dasc/eclipse_IDE_Diamond/
    ls -la /dls_sw/dasc/eclipse_IDE_Diamond
    
  2. install the distribution into the modules system:

    tarball=/dls_sw/dasc/eclipse_IDE_Diamond/eclipse${eversion}_linux${arch}_${today}.tar.gz
    install=/dls_sw/apps/eclipse
    tar -zxf ${tarball} -C ${install}
    java -version
    ${install}/eclipse${eversion}_linux${arch}_${today}/eclipse -initialize
    chmod -R a-w ${install}/eclipse${eversion}_linux${arch}_${today}
    gedit ${install}/HISTORY.txt
    gedit /dls_sw/apps/Modules/modulefiles/eclipse/<whatever>