OpenMRS Stand Alone Reference Application
Reference Application 2.10.0
Question:
So I am very new to this application, and am trying to set this up for a mobile clinic I am a part of. I am trying to set up the standalone reference app, but it won’t work…I get the following error message when I run the Java file…
Exception in thread “driver_launched_mysqld_2” com.mysql.management.util.WrappedException: java.io.IOException: Cannot run program “/Users/kunalkapoor/Desktop/EMR/openmrs-standalone-2.3.1/database/bin/mysqld”: error=86, Bad CPU type in executable
at com.mysql.management.util.Exceptions.toRuntime(Exceptions.java:55)
at com.mysql.management.util.Exceptions$Block.exec(Exceptions.java:89)
at com.mysql.management.util.RuntimeI$Default.exec(RuntimeI.java:180)
at com.mysql.management.util.Shell$Default.run(Shell.java:140)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.io.IOException: Cannot run program “/Users/kunalkapoor/Desktop/EMR/openmrs-standalone-2.3.1/database/bin/mysqld”: error=86, Bad CPU type in executable
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
at java.base/java.lang.Runtime.exec(Runtime.java:590)
at com.mysql.management.util.RuntimeI$Default$1.inner(RuntimeI.java:177)
at com.mysql.management.util.Exceptions$Block.exec(Exceptions.java:86)
… 3 more
Caused by: java.io.IOException: error=86, Bad CPU type in executable
at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
at java.base/java.lang.ProcessImpl.(ProcessImpl.java:319)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:250)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
… 7 more
Would anyone have any insight on how to get around this? I don’t have much technical experience, but am willing to learn!
Unfortunately, it seems like we can’t support the standalone on Mac OS Catalina. The problem is that to support a zero-configuration database setup, we’ve been using MySQL’s MXJ product, which bundles the MySQL executable in a manner that can be launch from a Java application. Unfortunately, that product was discontinued in 2012, though it’s still distributed. Being from 2012, it was last released with only support for 32-bit processors on Mac OS. Since Catalina no longer supports 32-bit executables, it won’t work on Catalina.
That’s not to say that we cannot get OpenMRS to run in your environment, just that we probably cannot get the current version of the standalone to run there.
Probably the easiest way forward would be to install Docker Desktop for Mac and use this docker-compose file to setup an environment (just save a copy of that file locally and run docker-compose up).