Core 2.7 - Errors when building locally

The build fails every time on running mvn clean package. What can be done?

@itsgurmannatsohal sorry about this. Kindly do you mind shading more light on what you were doing before the error you share?

I was following the set up instructions given in readme.md. I had just installed Java JDK version 17.0.5 and Apache Maven 3.9.0. After doing this, I executed mvn clean package and received this error

Oh sorry! Apparently Openmrs doesn’t support java 17. Kindly downgrade to any version ranging from Java 8 - 15.

Kindly share to link to the guide you are following please!

Like @jwnasambu has stated, we are currently not supporting java 17 so downgrading to java8 could be very ideal for you right now.

Support for java 17 is part of the platform roadmap

Oh okay, I’ll downgrade and check again. I am following the readme here: GitHub - openmrs/openmrs-core: OpenMRS API and web application code

This worked. But on setting up the database, it says:

Unable to create the database. The password might be incorrect or the database is not started. ???Error executing sql: create database if not exists ? default character set utf8 - Could not create connection to database server. Attempted reconnect 3 times. Giving up.???

I’m using mysql 5.7.24 on fedora 36

I think during the server setup, chose installing mysql along the setup not using already installed mysql.

I chose installing the demo data along with database setup. When I tried without the demo data, it worked but I got this

Some older similar issues were resolved by downloading the ‘Reference Application - 2.12 - Standalone Edition’, which I tried and it stopped here image

I haven’t proceeded any further yet.

Could you please provide a set up guide that I can follow? I have an issue assigned but am unable to work on it. Thank you

Hi @itsgurmannatsohal read through this Set Up Development Environment (Backend) - Documentation - OpenMRS Wiki and follow the steps to setup your system. Which system are you running on you machine? Do not hesitate to ask any doubt of problem faced during the setup process.

Thank you @njiddasalifu. I’m using fedora 36

Okay @itsgurmannatsohal since its linux distro just follow the steps kindly and everything will go well. you do not even need any software installed yet eg like mysql server. during the setup, it will be installed when you choose to do.

Okay. I’ll just follow the guide you sent

The guide says we need java 8 but I’m facing some trouble adding it to the environment variables. Would java 11 work?

@itsgurmannatsohal I think even java 11 can work. I am running java 11 and my setup is okay.

The SDK requires version 8. The process won’t continue with any other version. image

Hi @itsgurmannatsohal I suggest you unstall the java in system and do a clean reinstall. It might solve the problem. or you force install the java 8 version.