OpenJDK 11: to upgrade or not to upgrade..

udg

Expert
Licensed User
Longtime User
.,.
To upgrade, or not to upgrade, that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of "outdated" SDK,
Or to take arms against a sea of troubles
adapting everything to newer stuff

Just borrowed some excellent poetry and turned it to <put here your preferred word>... :)

Anyway, I'm currently using Java 8 for anything (server projects, desktop projects, mobile projects). Surely I'm not an early adopter (hehe), but it's clear that going 8 to 11 it's now more than a suggestion; it's becoming day by day a need.
For what I've read it seems that the biggest "problem" is the lack of the double-click to start a jar program (and a simple batch could cure it; afterall double-clicking the jar or the bat ain't that different..).
My main concern is about strong backward compatibility. Will my Jetty-based server programs still compile and work untouched? Would I need to upgrade/modify anything on my server? What if I develop using JDK11 and the server still is on its JDK/JRE 8? Any foreseeable problem?

To summarize: I know I should upgrade and I will do it anyway. Just posted to scout for something I could have missed and advice from who already took the upgrade path.

BTW, I am aware that I could have both 8 and 11 on my dev machine (and different versions of B4X products too), but I prefer to make up my mind once and then stick to that decision for a long time.
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Will my Jetty-based server programs still compile and work untouched?
Yes.

Would I need to upgrade/modify anything on my server?
You need to copy OpenJDK 11 to the server.

> What if I develop using JDK11 and the server still is on its JDK/JRE 8?
It will not work.
 

udg

Expert
Licensed User
Longtime User
You need to copy OpenJDK 11 to the server.
Should it be the one downloaded from the Products/Installation page on this site or should I use my CentOS 7 command:
sudo yum install java-11-openjdk-devel (or even, sudo yum install java-11-openjdk , for JRE only) ?

A related question: should I delete/rename the folder now used for JDK 8?

My plan is to rename current folder to something like "java8", install JDK 11 (presumably it will automatically go to folder "java") so not to modify my services which start with commands like:
ExecStart=/usr/bin/java -Xmx256m -jar /opt/udgapps/varius/varsvc1.jar

What do you suggest? Is it a proper way to upgrade th server? TIA.
 

udg

Expert
Licensed User
Longtime User
Thank you, Erel.
It's a VPS, CentOS 7 server which executes a few services based on jServer (jetty), an MQTT server and almost nothing else.
Currently I use a Let's Encrypt certificate, but in a short time I'll switch to a Comodo one.

So, in theory, I should be fine with the standard (yum downloaded) OpenJRE but I'm inclined to install the OpenJDK version anyway.
No JavaFX needed on this box. In the event I'll need a self-developed UI tool, I think that I will download raw data to a PC and analyze them locally.

One last question: should I first compile and have ready my services (once Java11-based) and then install OpenJDK11, right? Or existing java8-based services will still run under OpenJDK11 for the time needed to prepare the new versions? I'd like to keep it at a minimum the unavailability of the programs.
 

OliverA

Expert
Licensed User
Longtime User
Personal anecdote: Java 8 apps run fine under 11. For edge cases, you can always have both JREs installed on server (technically JDK not required)
 

udg

Expert
Licensed User
Longtime User
Java 8 apps run fine under 11
Good to know. This let me upgrade the server on Sunday and restart existing services (jserver-based services), buying me some more time to upgrade the dev system and to recompile those same apps too.
I saw installations with both Java8 and Java11, but I prefer to keep things simple so, once took the decision to upgrade, I will rather go to the single installation strategy.
Yes, JRE will suffice (in my case), but won't be a full JDK a better choice in the long run (who knows what will be the needs in time)?

Based on your hints, I will procede like this:
1. On Sunday, upgrade my server to OpenJDK11 through the internal yum command.
2. Restart existing java8-based services.
3. On next week, dowload from Anywhere Software products' pages all the stuff needed for a fresh installation (OpenJDK11-based). Install and test.
4. Recompile the existing services deployed on the server with the upgraded java11-based tools. Upload the new versions to the server.

Point 4 will lag behind for some days due to other must-do tasks, but knowing that everything will be still working right avoids any unwanted urgency.

Thank you both.
 
Top