SDK: The JDK 1.7.0_79 is not compatible with OpenMRS Platform 2.3.

Hi all, @raff,

Application Name: SDK Version Number: 3.0.0 Question: Is it normal that I am getting this all of a sudden when starting Jetty?

The JDK 1.7.0_79 is not compatible with OpenMRS Platform 2.3. Please use JDK 1.8 to run this server.

Upgrading to Java 8 solves the above strictly speaking, but it still breaks my dev environment since I cannot remote debug anymore in Eclipse. I thought perhaps my sources where out of sync with the JARs previously built with Java 7 so I rebuilt the Platform and my module in development with Java 8, to no avail. I keep looking but if anyone could save those frustrating hours of plumbing that I have not asked for, I would be really grateful!


P.S. Moreover I believe that ‘OpenMRS Platform 2.3.’ is not a valid reference. I am in fact running the Ref App distro 2.3 on Platform 1.11.4. All this was working perfectly fine with Java 7 until this morning.

Platform 1.x should not require Java 8.

Did you change anything else recently?

Okay, I just tried using the SDK for the first time in a while and I get the error message:

The JDK 1.8.0_74 is not compatible with OpenMRS Platform 1.11.5

This combination used to work before. @raff, did you all break something in SDK 3.0?

Per @mksd’s error, you should be allowed to use JDK 7 with a Refapp 2.x version that runs on top of Platform 1.x.

Per my error, you should not be prevented from trying to run Platform 1.x with Java 8, even though it doesn’t require it.

Hi @mksd

During development of SDK, format of server properties file had been changed. SDK 2.x has bug, it saves version of distribution as openmrs.platform.version. Now, if you set up your server with SDK 2.x and try to run it with SDK 3.0, it reads version of reference application as version of platform, and shows error. Unfortunately your use case had been overlooked. SDK 3.1 is going to be released very soon and certainly it will fix some problems with compability, we’re sorry for inconvenience.

It is recommended to setup new server with SDK 3.0, but if you don’t want to do it, go to openmrs/{serverId}/ in your home directory, and edit openmrs-server.properties file (if there isn’t any, open installation.properties). Set openmrs.version to 2.3 and openmrs.platform.version to 1.11.4 (basically switch it). After you save changes and run server again, all should work fine.

@darius this message you got is intentional. Again, it is recommended to setup new server with SDK 3.0. During setup, user can choose JDK he/she wants to use when running particular instance of OpenMRS. I think @raff can explain purpose of this design much better than me.

Thanks @gutkowski for stepping in!

@mksd I’m sorry for the inconvenience. To address your other issue with debugging please see updated instructions at http://om.rs/sdk. In short you either need to connect to your server using a remote debugger or run the server with -Dfork=false.

@darius, I’ve experienced a number of issues when running RefApp with Java 8, thus wanted to prevent users from going that path. From previous conversations I understood we don’t plan to fix 1.x platform releases to be runnable on Java 8, thus I didn’t even report the issues.

Hi guys, thanks all for jumping on the thread because this was a blocker for me!

Those two tweaks did the job!

But how did that happen that my SDK was upgraded to 3.0.0, I don’t remember ever doing anything about it?

It happens automatically, whenever we release.

You can continue to use older versions by explicitly stating version e.g. mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:2.1.2:help

mvn openmrs-sdk:help will be always the latest released version.

Just wanted to update you that in SDK 3.1 we will make it just a recommendation to use JDK 7 with platform 1.x instead of a strict requirement so you will be able to use JDK 8 for platform 1.x.

That’s very helpful, thanks!

Thanks, I’ll appreciate this. (So you know, my use case is that I don’t necessarily care about having the entire reference application run correctly, but I may just want to see how a particular module behaves, and I don’t want to have to switch between Java versions.)

PS- Peeking at a server instance (that I had created before with a 2.x SDK version) I see in the openmrs-server.properties file:

user_modules=org.openmrs.module/reporting/0.9.10-SNAPSHOT,org.openmrs.module/webservices.rest/2.14,org.openmrs.module/reportingrest/1.6,org.openmrs.module/reporting/0.10.1-SNAPSHOT

I don’t know if the duplication of reporting is a bug or a feature.

Broadly I don’t know how the different properties files are used, and I don’t know what the different lines in openmrs-server.properties mean. It’s probably worth documenting this on the wiki.

For reference, I had a run configuration in IntelliJ that used to work for remote debuggin in SDK 2.x, with -Xmx2048m -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000. Now, however, when I run this it looks like:

/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/bin/java -Xmx2048m -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 “-Dmaven.home=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3” “-Dclassworlds.conf=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin/m2.conf” -Didea.launcher.port=7532 “-Didea.launcher.bin.path=/Applications/IntelliJ IDEA.app/Contents/bin” -Dfile.encoding=UTF-8 -classpath “/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds-2.4.jar:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar” com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=2016.1.2 openmrs-sdk:run -DserverId=reporting Listening for transport dt_socket at address: 8000

and it hangs there. To make this work in SDK 3.0 I had to set up a run configuration with:

Command line: openmrs-sdk:run -DserverId=reporting -Dfork=false VM options: -Xmx2048m -XX:PermSize=256m -XX:MaxPermSize=512m

Thanks for this @darius. It’s a bug and will be fixed in SDK 3.1 release