Upgrading From jdk 8 to OpenJDK 11

Hello community I suggest we use OpenJDK 11 instead of OpenJDK 12 for this issue because the former is LTS though the latter is the latest release.

FYI @mozzy

2 Likes

Supporting all the way from Java 8 to 11 would be awesome! :slight_smile:

1 Like

Even with openjdk 11 , it is still failing to compile. Pointing me to version 8. https://pastebin.com/gquu0cgU

FYI @mozzy

1 Like

@irenyak1 but have you updated the POM file with the version your trying out??

@irenyak1 , Looking at this source = 1.11 and target release: 1.11 in the error logs, you must be putting like 1.11 in your POM . sorry i think i didnt make that clear on the Ticket. with java 9 and above , it should be , for example

<java.version>11</java.version>

not

<java.version>1.11</java.version>

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.

@irenyak1

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.

2 Likes

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