You can try like the below
InternetExplorerDriverService ieService = InternetExplorerDriverService.createDefaultService();
DesiredCapabilities caps = new DesiredCapabilities();
caps.setAcceptInsecureCerts(false);
caps.setBrowserName("internet explorer");
caps.setCapability("ie.edgechromium", true);
System.out.println("caps.getBrowserName() = " + caps.getBrowserName());
System.out.println("caps browserName = " + caps.getCapability("browserName"));
caps.setCapability("ie.edgepath", "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe");
InternetExplorerOptions options = new InternetExplorerOptions();
options.enablePersistentHovering();
options.ignoreZoomSettings();
options.requireWindowFocus();
options.setCapability("ignoreProtectedModeSettings", true);
WebDriver driver = new InternetExplorerDriver(ieService, options.merge(caps));
driver.manage().window().maximize();
driver.get("https://github.com");
if this launch the Internet Explorer, then one of the prerequisites is to enable IE11.
Just refer to this doc: Edge IE mode-Prerequisites.
And as far as I know, IEdriver
will start any version of IE installed in the machine, when Edge IE mode conditions are not met, it will not launch Edge, but default Internet Explorer.
So you could upgrade the version of IE to 11. I think this should make it work.