Linux: Java Error "No such file or directory" When Running a Scan

Problem

Important: If you have installed a new version of Java on a Linux distribution, removed the old one, and IBM Automatic Data Lineage was already installed, you may encounter an error when running a scan saying “No such file or directory”. This is most likely because the $JAVA_HOME and $JRE_HOME paths are pointing towards an invalid location.
During the installation process in a Linux environment, Automatic Data Lineage installer automatically detects all Java versions available. Based on which one you choose to use, Automatic Data Lineage installer automatically creates $JAVA_HOME and $JRE_HOME variables and stores them in the default settings for the Linux OS.

Solution

First we need to determine what Java version is installed and the installation folder location.

These steps use the bash command line and vi editor.
  1. Open the command line and run the “whereis java” command.

  2. You should receive a path similar to: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10/jre.

By default, Automatic Data Lineage uses the main java path and extends it by adding “bin/java” so it is enough to point to the location of the main folder.

Now that we know which Java path should be used, we need to change the environment variables that were previously set.

  1. Run the command: vi ~/.bashrc or ~/.bash_profile or ~/.profile.

  2. Press "i" for insert mode.

  3. Find the line: export JRE_HOME=<full_path_to_java>.

  4. Here you need to change the path to match the newest Java installation, which in this case would be:
    JRE_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10/jre.

  5. Once done, press escape to exit insert mode.

  6. Write ":x!" to save the changes and quit the editor.

  7. Run the command: source ~/.<file_you_edited> or log off the user from the command line and log back in.

Now Java should be correctly matched to the version used. You need to restart the service for the changes to take effect.