Frequently Asked Questions
Q: How do I get started with setting up a database and building the code?
A: This guide explains it all.
Q: How do I get an overview of the overwhelming DHIS 2 source code?
A: Remember that DHIS 2 is modular, and you will basically have to comprehend the modules you will be working on. Read the developer documentation to get a proper understanding of the system.
Q: Eclipse gives me lots of red warnings and cannot resolve classes, what am I doing wrong?
A: DHIS 2 depends on Maven dependency management and you must inform Eclipse where to find your local Maven repository by setting a classpath variable M2_REPO (Preferences - Java - Build Path - Classpath Variables).
Q: How do I resolve complaints from Eclipse saying that AspectJ related classes like JoinPoint cannot be found?
A: There is a problem related to the Eclipse AspectJ plugin and the Maven AspectJ dependency. DHIS 2 is built with Maven so this has no practical implications, you can safely ignore it.
Q: How do I start DHIS 2 for testing and debugging purposes?
A: First invoke "mvn clean install" on the root POM (dhis-2/pom.xml). Second invoke "mvn clean install" on the web root POM (dhis-2/dhis-web/pom.xml). Navigate to a web module (eg. dhis-2/dhis-web/dhis-web-reporting) or the portal (dhis-2/dhis-web/dhis-portal) and invoke "mvn jetty:run-war". The application will be accessible at "localhost:8080". In other words, there is no need to build the whole portal (which is time consuming) when doing development.
Q: What do I do when I get testing errors but still want to build the code?
A: Invoke "mvn clean install -DskipTests=true".
Q: From where do I get the source code?
A: All groups have been given a branch. The URLs are listed in the project groups document.
Q: What do I do when I get OutOfMemoryExceptions when building or running DHIS 2?
A: Try increasing the amount of memory given to the JVM by adding an environment variable "JAVA_OPTS" with the value "-Xms128m -Xmx768m -XX:PermSize=128m -XX:MaxPermSize=768m" depending on the available RAM on your computer.
Q: Why do I get compilations errors for things like String.isEmpty() ?
A: DHIS 2 uses some Java 6 features. Install and use a Java 6 SDK.
Q : I can't get the Maven Jetty plugin to run on Mac, how can I fix it?
A: Try setting an environment variable "MAVEN_OPTS" with the value "-Xmx512m".