Jvm: oracle vs openjdk vs

Just a quick post here about java jvm choices so we have it easily searchable.

It seems that the oracle jvm has become increasingly difficult to use, particularly in automated setups. See https://launchpad.net/~webupd8team/+archive/ubuntu/java.

My understanding is that there are no significant drawbacks in using the openjdk runtime. So the ubuntu package I am using for installations on ubuntu 18.04 bionic is openjdk-8-jre headless.

Note that there are currently issues running DHIS2 against higher java versions (eg 9 and 11) so it is a good idea to install the runtime first, before installing things like tomcat8 which could pull in an incompatible jvm as a dependency.

I welcome any thoughts on different jvms people might be using and why.

1 Like

Dear Bob,
I am sure i informed you about the Oracle PPA which had been discontinued. Now it is extremely difficult to do a new installation using the dhis2-tool or update the current java version that we have running. Please can you review the tool again so that we can have one which would not be giving issues to troubleshoot after installation.

1 Like

Hi Gerald

Its not really extremely difficult. Just install the jvm prior to installing the tools. At its simplest:

apt-get install software-properties-common
add-apt-repository -y ppa:bobjolliffe/dhis2-tools
apt-get -y update

apt-get -y install openjdk-8-jre-headless
apt-get -y install dhis2-tools

1 Like

Dear Bob,
This is for a situation for a new instance and thanks. So can we used the same for a current running dhis2 and then swap from the oracle-8 to the openjdk-8?

1 Like

Sure Gerald. If you have an existing installation you should probably do:

apt-get -y install openjdk-8-jre-headless

# set openjdk as default jvm
sudo update-alternatives --config java

After that you can probably just remove the oracle jvm. In fact that is probably a good idea if the ppa is no longer going to be receiving updates.

Remember you will have to restart all your dhis2 instances to make use of the updated java.

1 Like