Wiki Spaces

Documentation
Projects
Resources

Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack

Documentation

Page tree

Step by step setup guide for OpenMRS development environment

 

(This guide was designed for Linux Ubuntu 10.10,  x86– results may vary based on distribution and architecture)

 

Prerequisites:

1.) Install: Eclipse IDE for Java EE Developers

 

--Link: eclipse-jee-helios-SR2-linux-gtk.tar.gz (Select correct file and architecture)

-- Open terminal and  navigate to your download folder

su – or prefix all commands with sudo

tar -xvzf eclipse-jee-helios-SR2-linux-gtk.tar.gz -C / opt (varies by downloaded file name)

Add read permissions to all files

chmod -R +r / opt / eclipse

Create Eclipse executable on /usr/bin path

touch / usr / bin / eclipse

chmod 755 / usr / bin / eclipse

 

## Open eclipse file with your favorite editor ##

nano -w / usr / bin / eclipse

   (or graphically)

      gksu -u root gedit /usr/bin/eclipse

 

## Paste following content to file ##

#!/bin/sh

export ECLIPSE_HOME = "/opt/eclipse"

 

$ECLIPSE_HOME / eclipse $*

Create Gnome desktop launcher

## Create following file, with your favorite editor ##

/ usr / share / applications / eclipse.desktop

   ( graphically)

      gksu -u root gedit / usr / share / applications / eclipse.desktop

 

## Add following content to file and save ##

[ Desktop Entry ]

Encoding =UTF- 8

Name =Eclipse

Comment =Eclipse SDK 3.6.1

Exec =eclipse

Icon = / opt / eclipse / icon.xpm

Terminal = false

Type =Application

Categories =GNOME;Application;Development;

StartupNotify = true

 

 

2.)                Make sure JDK is installed

sudo apt-get install openjdk-6-jdk

 

3.)                Make sure MySql server is intalled (required for OpenMRS database)

: sudo apt-get install mysql-server

(You will be prompted to create a database password – don't forget this)

 

Configure Eclipse and Plugins

 

1.)                Launch Eclipse EE and create a new workspace  (Applications → Programming → Eclipse)

 

 

 

 

 

 

 

 

 

 

 

 

Install Subclipse (this is a plugin that integrates Subversion/SVN into Eclipse.)

1.)Navigate to “Help → Install New Software”

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2.)

In the “Work with:” text field type: “ http://subclipse.tigris.org/update_1.4.x ”, press “select all” packages, click next through the dialog box (accepting license agreement via checkbox), and               press finish.               (When complete you will be asked to restart eclipse – press yes)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  Install Maven (Dependency and build system plugin for eclipse)

1.)

Go back to “Help → Install New Software”

2.)

In the “Work with:” text field type: “ http://m2eclipse.sonatype.org/sites/m2e ”, select all packages, click “next” through the dialog box (accepting license agreement via checkbox), and press finish. 

(When complete you will be asked to restart eclipse – press yes)

 

Install Maven Extras

1.)

Go back to “Help → Install New Software”

2.)

In the “Work with:” text field type: “ http://m2eclipse.sonatype.org/sites/m2e-extras ”, select all packages, click “next” through the dialog box (accepting license agreement via checkbox), and press finish.  (When complete you will be asked to restart eclipse – press yes)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Check out source code from repository

1.)

Note** You may need  to click on the “workspace” icon in the top right corner of the main panel , which should put you               in the Java perspective by default

 

Navigate to: “File -> New -> Project -> Maven Drop Down  - Checkout Maven Projects From               SCM

 

2.)

  • For the “SCM Url” dropdown menu, choose svn and type into the url text field: http://svn.openmrs.org/openmrs/trunk .
  • Click  advanced to expand more options. In the “ Name Template ”, type a project name
  • (we used openmrs-trunk )
  • Press Finish

 

 

 

 

 

 

 

 

 

 

 

** Wait for checkout to complete before proceeding

 

 

Install OpenMRS

1.)                 

In the project explorer panel, right click on the project which has been created and navigate to “Run as → Maven Install”  (this may take some time to complete)

Build Maven Project

**Review console notifications to makes sure Maven installation was successful.

1.)

Expand the project and navigate to the “webapp” folder. Right click and select “ Run As - Maven Build

 

 

 

 

 

 

 

 

 

 

 

 

2.)

In the “Goals” text field enter: “jetty:run” which will start the java application server locally. Press the Run button

 

Configure OpenMRS installation for the first time

1.)                Once the jetty application server is running (via Maven Build, last step), point your browser to http://127.0.0.1:8080/openmrs/initialsetup

2.)                Click on the “Advanced” installation option and press continue.

3.)                Follow these configuration instructions .

**Note: you will need to recall the MySql password you created in this step

4.)                You should now be able to login to OpenMRS via  http://127.0.0.1:8080/openmrs

Notes

When making most code modifications, you need to complete a Maven Install. You may cut down on compile time by skipping OpenMRS tests if desired. This can be done by creating a new run configuration for the project and typing  into the “Goals” textfield the word “install”, and checking the checkbox which says “skip tests”.

 

 

Setup guide created by Jon Polaski and Todd Binger of Western New England University.