How to open chrom with profile2

it doesn`t work

String userProfile= "C:/Users/Leonid/AppData/Local/Google/Chrome/UserData/Profile 2" 
ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir="+userProfile);
options.addArguments("--start-maximized"); 
WebDriver driver = new ChromeDriver(options); 
driver.get("http:/www.google.com");

Some body know?

Specify which error you get.

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.htmle[0;39m

Put this line before creating ChromeDriver.

System.setProperty("webdriver.chrome.driver", DriverFactory.chromeDriverPath)

Its opens chromeBrowers but…
not with profile2 (Chrome is being controlled by automated test software)

String userProfile= “C:/Users/Leonid/AppData/Local/Google/Chrome/User Data/Profile 2”
ChromeOptions options = new ChromeOptions();
options.addArguments(“user-data-dir=”+userProfile);
options.addArguments(“–start-maximized”);
System.setProperty(“webdriver.chrome.driver”, DriverFactory.chromeDriverPath)
WebDriver driver = new ChromeDriver(options);

The problem doesnt have solution?