How can I include ChromeDriver in a JAR?
eclipse, google-chrome, jar, java, selenium
Solution
It's in the Jar but cannot be executed (same as trying to run an .exe from a zip file), you have to extract it before running it
Problem
I'm writing a web-automation program and so far, it works fine using Selenium's FirefoxDriver. However, I want to make it use Chrome if Firefox is not installed. I downloaded the ChromeDriver, put it inside a folder in my Eclipse project, and ran it. After I added `System.setProperty("webdriver.chrome.driver", "Drivers/chromedriver.exe");` it worked fine. However, when I try to export it (using Eclipse's standard Export). It crashes, I believe because it can't find the ChromeDriver (I think this because exporting it with FirefoxDriver works fine). I have tried changing the .JAR to a .ZIP in order to look inside, and I see that the `driver` folder was stripped away, simply putting `chromedriver.exe` inside the top-level JAR. I tried changing the property to `System.setProperty("webdriver.chrome.driver", "chromedriver.exe");` but still crashes. Does anyone know why the exported JAR is unable to find `chromeDriver`, despite the fact that I have verified that it is in the JAR? Thanks, Daniel