Q:

Selenium script not working Exception

I am beginner to selenium and need some help with below script where I am trying to send value vai text field. 
Below is the code snippet. 
import org.openqa.selenium. By;
import org.openqa.selenium. JavascriptExecutor;
import org.openqa.selenium. WebDriver;
import org.openqa.selenium.chrome. ChromeDriver;

public class login {
    static
    {
        System.setProperty("webdriver.chrome.driver", "./driver/chromedriver.exe");
    }

    public static void main(String[] args) 
    {
        WebDriver driver=new ChromeDriver();
        driver.get("https://XXXXX.XXXXXX.com/authentication/login");

        driver.findElement(By.name("login")).sendKeys("ravi");

    }

}

Shows error

Exception in thread "main" java.lang. IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver.  The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
      at com.google.common.base. Preconditions.checkState(Preconditions.java:754)
      at org.openqa.selenium.remote.service. DriverService.findExecutable(DriverService.java:124)
      at org.openqa.selenium.chrome. ChromeDriverService.access$000(ChromeDriverService.java:32)
      at org.openqa.selenium.chrome. ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
      at org.openqa.selenium.remote.service. DriverService$Builder.build(DriverService.java:339)
      at org.openqa.selenium.chrome. ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
      at org.openqa.selenium.chrome. ChromeDriver.(ChromeDriver.java:123)
      at login.main(login.java:14)

A:

try this code :  
public class login {

public static void main(String[] args) {
 System.setProperty("webdriver.chrome.driver","Path/to/your/chromedriver.exe");
 WebDriver driver=new ChromeDriver();
 WebDriver wait = new WebDriverWait(driver,30); 
 driver.get("https://XXXXX.XXXXXX.com/authentication/login");
 wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.name("login"))));
 driver.findElement(By.name("login")).sendKeys("ravi");  

