I am getting this exception:
Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
This is my code:
String torPath = "C:\\Users\\camil\\Desktop\\Tor Browser\\Browser\\firefox.exe";
String profilePath = "C:/Users/camil/Desktop/Tor Browser/Browser/TorBrowser/Data/Browser/profile.default";
File torProfileDir = new File(profilePath);
FirefoxBinary binary = new FirefoxBinary(new File(torPath));
FirefoxProfile torProfile = new FirefoxProfile(torProfileDir);
torProfile.setPreference("webdriver.load.strategy", "unstable");
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setBinary(binary);
firefoxOptions.setProfile(torProfile);
FirefoxDriver driver = new FirefoxDriver(firefoxOptions);