Symfony JAVA_HOME not set

  fedora, java, laravel, symfony

When trying to run signal-cli via Symfony it errors:

JAVA_HOME is not set and no ‘java’ command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation.

Output of echo $JAVA_HOME in the working directory:


Output of java -version in the working directory:

openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-bit Server VM (build 25.252-b09, mixed mode)

I’m trying to figure out how to resolve the error. Here is my code:

public function list()
  $list = new Process(['.././signal-cli-0.6.8/bin/signal-cli']);

   if (!$list->isSuccessful()) {
       throw new ProcessFailedException($list);
    echo $list->getOutput();

Source: Symfony Questions