All OpenMRS ID accounts have been reset.

Read more and change your password before signing in.
Icon

EXTENDED: OMRS14 Proposals due 30 April! Read more and submit a proposal at OpenMRS Talk.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

Step by step setup walk through for Linux Developer Installation

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

Notice that the step named Build Maven Project below also works on Windows 7 / 64.

Prerequisites:

  1. Install: Eclipse IDE for Java EE Developers
  • Open terminal and  navigate to your download folder
    su – or prefix all commands with sudo
  • Extract files
  • tar -xvzf eclipse-jee-heliosjuno-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 roo+t 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 installed (Required for OpenMRS Database)*

  • sudo apt-get install mysql-server

 *** NOTE: You will be prompted to create a database password, do not forget this as you need it later on!!!

Configure Eclipse and Plugins

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

Image Removed

Install Subclipse (Plugin that integrates Subversion/SVN into Eclipse)

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

Image Removed

  •  
  • Install Maven (Dependency and build system plugin for Eclipse)## Go back to "Help -> Install New Software"## 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)

  Image Removed

  • Install Maven Extras## Go back to "Help -> Install New Software"## 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)

   Image Removed

  1. See How to install Eclipse plugins sections here

Check out Source Code from repository

** NOTE ** You might need to click on the workspace icon in the top right of Eclipse main panel to get into the Java perspective.

  • Navigate to "File -> New -> Project -> Maven Drop Down -> Checkout Maven Projects from SCM"

  Image Removed

  • 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

  Image Removed
** Wait for checkout to complete before proceeding.

  1. See how to check out a maven project from a Git repository here

Install OpenMRS 

  • 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.

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

 

  • In the “Goals” text field enter: “jetty:run” which will start the java application server locally. 
  • In the JRE tab, put in the following VM arguments: -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m
  • 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. http://127.0.0.1:8080/openmrs/initialsetupClick on the “Advanced” installation option and press continue.
  3. Follow these configuration instructions## ** NOTE this is where you will need the mysql database password from before
  4. You should now be able to login to OpenMRS via http://127.0.0.1:8080/

Default Login Details for your Locally hosted OpenMRS

  • Username : admin
  • Password : either "Admin123" or "test"
End 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”.

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