Setting Up Your Development Environment for the Code Jam

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.

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