Info |
---|
Below is a listing of software applications that you will need to install in order to develop on the OpenMRS Platform code base. The installation process may vary somewhat for Windows, Linux (Step By Step Instructions), or Mac OS X platforms (Step-By-Step Instructions). Still, the OpenMRS Platform depends mostly on Java which runs the same across those systems. This list will try to describe the software which you should install to start work on any development computer. |
...
If using a JDK in Eclipse, then navigate to Window -> Preferences -> Java -> Installed JRE's to check if the JDK has been set. If not, do so.
Note: It seems that attempting to use Java 10 on Windows causes a Maven build error with "error: package com.sun.tools.doclets does not exist". Using Java version 1.8 resolves this.
MySQL
MySQL is the database software most people use for the OpenMRS Platform database. You should know your MySQL root password, or have a database ready with username and password to install the OpenMRS Platform into. The latest version of OpenMRS Core supports MySQL 8.
Older versions of platforms need MySQL 5.6
For Linux (especially Ubuntu 20.04
) follow these steps to install MySQL 5.6
- Download the MySQL Community Server DEB Bundle from here. Select
5.6.*
as Product Version,Debian Linux
as Operating System and then download the 32-bit or 64-bit DEB Bundle as per the system’s requirement.
It basically contains individual packages likemysql-common
,mysql-community-client
,mysql-client
,mysql-community-server
, etc. - Install the packages individually using
dpkg -i <package-name>.deb
. - Note that it will be required to go in a certain order for installing the packages, which could be found out by trial-and-error (see the error messages if any for the other package’s requirement).
- In case there is some error for missing dependencies, run
sudo apt-get install -f
.
...
This order of installation works for Ubuntu 20.04.
Install the .deb
packages in the following order:
sudo dpkg -i mysql-common_5.6.47-1debian9_amd64.deb
sudo dpkg -i mysql-community-client_5.6.47-1debian9_amd64.deb
sudo dpkg -i mysql-client_5.6.47-1debian9_amd64.deb
sudo dpkg -i mysql-community-server_5.6.47-1debian9_amd64.deb
You might also need to install libaio1
package. Use this command :
sudo apt-get install libaio1
If you see errors, Re run the following commands :
sudo dpkg -i mysql-common_5.6.47-1debian9_amd64.deb
sudo dpkg -i mysql-community-client_5.6.47-1debian9_amd64.deb
If you get some errors about missing dependencies, Run sudo apt-get install -f
.
That’s it, MySQL 5.6
will be installed successfully!
Install And Configure Your IDE
Refer to the How-To Setup And Use Your IDE to either install an IDE or configure the one you have for OpenMRS development.
...
For specific instructions for using Egit and Maven tools you have installed above, see Git IDE Integration.
If you are contributing to the OpenMRS Platform code base, you want to check out "openmrs-core". If you want to contribute to a module, you should check out the release branch for the module's lowest required OpenMRS Platform version (e.g.1.8.x or 1.9.x). OpenMRS began using Maven in 1.8.x, so for modules that run on earlier versions of the OpenMRS Platform, you may find it easier to just check out1.8.x and test against that.
Compiling the OpenMRS Platform
Use Maven to compile and generate source files.
...
Before trying to run the OpenMRS Platform ensure you have MySQL running. Also, it is highly recommended to increase the memory available by following the steps in the Maven setup, or see Troubleshooting Memory Errors.
You can now run the OpenMRS Platform by deploying the built WAR file into a J2EE container such as Tomcat or Jetty, or you can run it directly from the source code using the Maven Jetty plugin. The latter method is easier for developers as you can launch it from your IDE. However, if running this way for the first time, you will need to first manually install the core logic module. To do this, download the logic omod and copy it to your modules directory. Then If you choose to use the Maven Jetty plugin, you can start the OpenMRS Platform as follows: move into the "webapp" directory and execute following command
...
Note: The latest version of openMRS core supports only mysql 5.6 7 Server and above. An error might flag if the version is over below 5.6.
Installation for Developers On Windows supplemented with images.
(Optional) Module development
...
If the module's source code is in Git, follow the Using Git instructions. If the module's source code is in subversion and the module is mavenized (i.e. it has a pom.xml file) then you should follow the same process described for the core code.
Older modules may be in subversion, and not yet mavenized (i.e. they have no pom.xml file). To check these out do New -> Checkout project from SVN.
To create a new module, we recommend Using Git and Using the Module Maven Archetype.
After you cloned a module you need to build it with mvn clean install.
...