I am also facing the same issue and got the resolution after a day :
The exception is coming because System needs Geckodriver to run the Selenium test case. You can try this code under the main Method in Java
System.setProperty("webdriver.gecko.driver","path of/geckodriver.exe");
DesiredCapabilities capabilities=DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
WebDriver driver = new FirefoxDriver(capabilities);
For more information You can go to this https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver link.
Please let me know if the issue doesn't get resolved.