Prerequisites : ChromeDriver is downloaded
Copy the following code into your class.
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "path of the exe file\\chromedriver.exe");
}
If you're using linux, give the path to the ChromeDriver Binary.