'Chromedriver tests cannot be run when using PATH variable on Linux

I'm trying to run Java Selenium test with chromedriver on Linux. I have added the driver to the PATH variable, but I am still getting the following error:

IllegalStateException: The path to the driver executable The path to the driver executable must be set by the webdriver.chrome.driver system property;

I've added the driver to $PATH directly into the "environment" file in the etc directory. I've checked if it works and it does.
enter image description here

The versions of both the browser and the driver are the same. In addition, when I try to add the path using "System.setproperty()", I get another error:

IllegalStateException: The driver executable must exist:

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source