Skip to content

Installing and Configuring Eclipse

John Paden edited this page Jun 2, 2016 · 14 revisions

Eclipse is an integrated development environment that can be useful for editing and debugging the OPS Django application. This page is intended to be a guide for setting up Eclipse in the OPS development VMs. For information on how to use eclipse, see Using Eclipse.


Downloading and installing Eclipse

Installing PyDev

Configuring OPS as a Django Project


Downloading and installing Eclipse

  1. From the VM, download the latest 64 bit version for Linux of the eclipse installer using Firefox. /download.php?file=/technology/epp/downloads/release/luna/R/eclipse-standard-luna-R-linux-gtk-x86_64.tar.gz&r=1).

  2. Enter the following lines of code in a terminal:

sudo -i # switch to root
tar -zxf eclipse-inst-linux64.tar.gz -C /opt # unzip, untar and send outputs to /opt/ directory
/opt/eclipse-installer/eclipse-inst # Run the installer
# Do the following in the installer GUI:
# Update the installer (menu in upper right corner)
# Choose "advanced mode" (menu in upper right corner)
# Choose "Eclipse Eclipse IDE for Java Developers". Note the Product Version: "Latest Release (VERSION)".
# Choose "Manage Bundle Pools" and create a new agent at /opt/eclipse-pool/pool
# Click "Next".
# Do not change setterings in "Projects". Click "Next".
# Check "Show all variables"
# Set "Installation folder name" to match your installation, see  (e.g. "Mars"). Remove any previous installation in that folder (e.g. rm -rf /opt/eclipse/Mars).
# Set "Root install folder" to "/opt/eclipse/"
# Click "Finish".
  1. Open the new /usr/bin/eclipse file with gedit: gedit /usr/bin/eclipse

  2. Paste the following into the file (replace VERSION with the "Installation folder name" you used above):

#!/bin/sh
export ECLIPSE_HOME="/opt/eclipse/VERSION/eclipse/"

$ECLIPSE_HOME/eclipse $*
  1. Save the file and exit gedit

  2. Make the file executable by running the following in a terminal:

chmod 755 /usr/bin/eclipse
  1. start eclipse from the terminal: eclipse&

  2. If everything worked propertly, a 'Workspace Launcher' will open. Accepting the default is fine.

  3. Remove eclipse*.tar.gz from /home/ops/Downloads: rm -f /home/ops/Downloads/eclipse*.tar.gz

Installing PyDev

Pydev is a plugin for Eclipse that enables Python and Django projects.

  1. From the toolbar, navigate to Help->Install New Software...

  2. Click 'Add' next to the 'Work with' and enter PyDev for name and http://pydev.org/updates for location.

  3. Check the 'PyDev' selection box after it appears and click Next.

  4. Select PyDev for Eclipse and click Next.

  5. Accept the terms of the license agreement and click Finish. When a 'Selection Needed' box appears, check the box next to 'Brainwy Softward; PyDev; Brainwy' and press OK.

  6. Restart eclipse when prompted.

Configuring OPS as a Django Project

  1. Select File -> New -> Project

  2. Select PyDev -> PyDev Project. DO NOT SELECT PyDev Django Project YET. Click Next.

  3. Name the project 'OPS'.

  4. Un-check 'Use default' under project contents. Enter /var/django/ops/ for the Directory.

  5. Click the 'Please configure an interpreter before proceeding' and select 'Manual Config'.

  6. A Preferences window will open. Click 'New...'. Put Python2.7 as the Interpreter Name and /usr/bin/venv/bin/python2.7 as the Interpreter Executable. Press OK. Click OK again when the 'Selection Needed' window appears.

  7. In the Preferences window, click 'Apply' and then 'OK'.

  8. Select Python2.7 under Interpreter.

  9. Click 'Finish' and select 'Yes' when prompted to open the PyDev perspective.

  10. Minimize the main Eclipse page by pressing the minus button near the upper right of the eclipse window.

  11. Press the Python icon on the upper left side of the eclipse window. Expand the selection so you can see the OPS project directory tree.

  12. Open one of the OPS files (ops->views.py, for example). Click 'OK' when prompted to set Default Eclipse Preferences for PyDev.

  13. Click 'Read it' when prompted to help keep PyDev alive.

  14. Expand the file opened in step 12 so it takes up most of the eclipse window. Leave the directory tree docked to the left side of the window (these can be changed later, but this is a standard view).

  15. Right-Click the OPS project at the top of the directory tree. Go to PyDev -> Set as Django Project.

  16. Right-Click the OPS project again and go to Properties. Select the PyDev-Django properties and put manage.py for Django manage.py and ops.settings for Django settings module. Press 'Apply' and then 'OK.'

  17. Eclipse and PyDev are now configured to recognize the OPS project as a Django application. See the Using Eclipse page for more information on how to effectively use Eclipse with OPS (Not available yet).