Installing multiple version of Java on Linux VDA - LVDA fails to register with DDC

Installing multiple version of Java on Linux VDA - LVDA fails to register with DDC

book

Article ID: CTX282554

calendar_today

Updated On:

Description

When installing different version of java on a LVDA VM it stops registering with the DDC.

Resolution

We can use the 'alternatives' tool to check and configure the environment, for LVDA we have to be sure that LVDA programs are running using java-1.8.0-openjdk, we can set the environment to use java-1.8.0-openjdk using alternatives and configure a different one for the user environment.
 
#alternatives --config java

There are 3 programs which provide 'java'.

Selection Command
-----------------------------------------------
*+ 1 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java)
2 java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.261-2.6.22.2.el7_8.x86_64/jre/bin/java)
3 java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.8.10-0.el7_8.x86_64/bin/java)

Enter to keep the current selection[+], or type selection number:

In the above scenario java-1.8.0-openjdk is being used as the systems default java. You can change the systems default java using the '#alternatives --config java' command.

-If you wish to change the default java for the user environment, lets say in this case to Java-11, we can find the path for each Java package installed on the system using the above command.
-Once you see all the paths, copy the one of your preferred Java version. In this case it's '/usr/lib/jvm/java-11-openjdk-11.0.8.10-0.el7_8.x86_64/'
-And add the path in the users .bash_profile as JAVA_HOME, example:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.8.10-0.el7_8.x86_64/
PATH=${JAVA_HOME}/bin:$PATH:$HOME/.local/bin:$HOME/bin

export PATH

 

Problem Cause

Linux VDA needs a specific version of Java to work properly, if another version of java is installed on the VM the services might use the other version of java and may fail to register with the DDC.