Upgrading From jdk 8 to OpenJDK 11

Like I told you on IRC , I have used <java.version>11</java.version> but it is still failing. please look through the error log here https://pastebin.com/n9QJP1r4

@mozzy this may not be directly related to my ticket but with openjdk 11 I am not able to run a server or set up one. look at this error log https://pastebin.com/7fpgMs5c

Still failing with a freshly cloned copy of the core. https://pastebin.com/ndZJzUuL

FYI @mozzy , @dkayiwa, @ruhanga

1 Like

@irenyak1 did you reset you OS path variable to point to openjdk 11??

@irenyak1 is that where the server stops to run ?? at this pont
>> Custom JDK path:

you seem not have configured properly the system path path variable on you OS. It may be still pointing to a wrong JAVA version that you dont have installed.


Thats right ,there’s some little backward incopatibility between java 8 and 11.

when i look at this in your logs

[ERROR] /home/irynah/Openmrs-Projects/openmrs-core/tools/src/main/java/org/openmrs/tools/doclet/ShouldTaglet.java:[143,1] error: method does not override or implement a method from a supertype

The Old Doclet API in java 8 was deprecatd and finally removed in java 11, and replaced with another new Doclet API. This will require some little bit of refactoring some code. You can start a Talk thread about this. I would have done so , but currently i have alot of tasks am handling at the same time. cc @dkayiwa

Not really @mozzy I was setting up a new server using openjdk11 but if you look into the error log it shows that, (copied section from the error log)

  1. [INFO] — openmrs-sdk-maven-plugin:3.13.2:run-tomcat (default-cli) @ standalone-pom —
  • Using JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64

  • Using MAVEN_OPTS: -Xmx768m -XX:MaxPermSize=512m

The JDK 11.0.3 is not compatible with OpenMRS Platform 2.1.4. Please use JDK 1.8 to run this server.

  • If you are running in a forked mode, correct the java.home property in /home/irynah/openmrs/openmrsserver/openmrs-server.properties

Note, I configured well my system path variable and it points to java 11.


Why not stay on JDK 8 which is an LTS version until 2022?

1 Like

I would agree with @ssmusoke on this. @mozzy what do you say about this?

True, while Oracle will stop providing support and mantainace for oraclejdk 8 and 11 unless the implementation pays for a licence , Red Hat takes on the role to support Openjdk 8 and 11 until June 2023 and October 2024 respectively. So may be its a good idea to still stick with java 8.

cc @dev4 and @dev5

If we wait till 2023 to upgrade , there will be more stuff to fix and will be more painful than now. Also openn jdk 12 will not be the latest by that time . I think its better to start upgrading soon.

1 Like

cc @dkayiwa , @dev4 @dev5 , whats your conclusion on this Ugrade??

  • If we decide to updrade to java 11, we shall need some code refactoring to be compatible will java 11 and if possible backward compatible will java 8. Simply because , research shows java 8 has been the most used version of java by java clients , considering all the way from java 1 to12

  • or we stick with java 8 for now??

What you take on this??

Also do ensure to maintain backwards compatibility with JDK 8. With UgandaEMR we have just completed a migration from JDK 7 & currently have over 1000 sites running, and cannot change for at least another 2 years.

1 Like

ya , thats really key

Do you have details of the exact changes that we would need to support Java 11?

1 Like

here in this talk post

One major change that affects us was the replacement of the Doclet API in java 11 with a new Doclet Api. So we would need to refactor all our code that depended to the old API , to depend on the new Doclet API

Does everything else compile on Java 11 if you delete the ShouldTaglet.java file?

From the infrastructure point of view, moving to OpenJDK 11 really helps me a lot to support CI capabilities.

The older the JDK, the more likely it’s not supported by the distribution we have.I’m having a lot of trouble supporting JDK 7 already.


@dkayiwa let me try deleting that file and run it again and see if it compiles.

1 Like