How to fix the “No drivers have been configured or have been found on PATH” error?

I would like to run Selenium server standalone 4 on my server. But as I try to run java -jar selenium-server-4-beta-2.jar standalone it throws me an error:

No drivers have been configured or have been found on PATH

I don’t understand what to do it. I have an actual driver file in the same directory as the jar file.

Can somebody tell me please what it means?

Answer

have you set the chrome driver path. you may want to set that

System.setProperty("webdriver.chrome.driver","Your Chrome driver locaton");
WebDriver driver =new ChromeDriver();