Setting Up Your Development Environment for the Code Jam

Below is a listing of software applications that you will need to install in order to develop in the OpenMRS codebase. The installation process may vary somewhat for Windows, Linux, or Mac OS X platforms. Still, OpenMRS depends mostly on Java which runs the same across those systems. This list will try to describe the general pieces that you should install to start work on any development computer.

Running OpenMRS

Demo Site

You can see OpenMRS running at http://demo.openmrs.org (username: admin, password: test).

Running OpenMRS on your computer

We have an alpha version of a "one-click" version of OpenMRS.  You can download a special version of the Standalone Application (1.9 nightly build with web services module included), unzip it, and execute the included jar file to quickly get OpenMRS running locally.  You can log into the standalone version as admin with password Admin123.

Running Your Own Build

To build & run OpenMRS locally, you either need an IDE environment (like Eclipse) with appropriate plugins for Subversion & Maven or, if you prefer to code in a text editor like emacs, you'll need the Java SDK, Subversion, and Maven.  In either case, you will need MySQL as well.

Dependencies to install

1. Java 1.6 SDK

Java is the language in which OpenMRS is written. The latest version of OpenMRS requires at least Java version 1.6. If you plan to edit the source, you will need the JDK; if you plan just to run OpenMRS, you will only need the JRE.

2. MySQL

MySQL 5.x is the database software in which OpenMRS stores its records. You should know your MySQL root password, or have a database ready with username and password to install OpenMRS into.

3. A Development Environment

You can choose between using an integrated development environment (IDE) or a text editor.  The majority of OpenMRS developers choose the IDE approach, since it provides several conveniences.

Eclipse (Helios 3.6.x) – an integrated development environment

Eclipse IDE for Java EE Developers is the recommended Java development environment. You will need the latest stable release but OpenMRS should still function on older versions that can use Maven integration.

Eclipse Plugins
Subclipse
  • Subclipse is a plugin that integrates Subversion/SVN into Eclipse. (recommended)
    • Use the version number in the footer of the OpenMRS Subversion repository to determine which version of the client to use. If the footer says something like "Powered by Subversion 1.4.2 (r22196)", use Subclipse v1.4.x update site.
    • For non-Windows32bit installations, be sure to read about setting up JavaHL for your platform.
    • SVNkit is the Pure Java alternative to JavaHL. If you use it, you do not need to configure platform specific binaries.
    • For Eclipse Helios you may find it convenient to use the Subclipse SVNkit integration, an optional part of Subclipse under "Subclipse SVNkit Option".
    • If you choose the Pure Java option, you may need to specify the SVNkit choice in the Preferences →Team → SVN panel.
  • Subclipse 1.4.x Update Site: http://subclipse.tigris.org/update_1.4.x
Maven M2e plugin + M2e Extras

Apache Maven is an open source build system similar to make or ant but it also manages dependencies. OpenMRS transitioned from the ant build system at the 2010 1.8 Hackathon on 19 August 2010. There are two different Eclipse integration plugins for Maven but OpenMRS developers tentatively recommend M2E. Be sure to install both the base packages and the SCM and Subclipse SCM extras packages from the extras update site.

OpenMRS Test Case Generator

Text Editor (emacs, notepad, textmate, etc.)

In order to development for OpenMRS using a text editor, you will need to download subversion and maven clients.

Tomcat (Optional)

Tomcat is a J2EE server on which OpenMRS can be deployed. You will want the core that matches your system specs the closest: probably 32-bit zip or 64-bit zip or bz2 on Linux. If you choose not to install Tomcat, the development-oriented J2EE server, Jetty already installs with Maven and integrates with the Eclipse Run and Debug workflow.

Check out code from subversion

Finally, and most importantly, you need to get the code from the Subversion/SVN revision control system by using the Maven tools you have installed. There are detailed instructions for this process here.

If you are going to work on the multiple encounters per provider ticket(s), then you can check out the branch of trunk here:

http://svn.openmrs.org/openmrs/branches/providers

Compiling OpenMRS

Use /wiki/spaces/docs/pages/25520545 to compile.

Within Eclipse, right-click on the project and choose Maven → Package.

If you are using Maven from the command line, go to the folder containing the OpenMRS project and use the command mvn package.