Symfony JAVA_HOME not set

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:

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-0.fc31.x86_64/jre

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']);
  $list->run();

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

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *