use of org.languagetool.server.PortBindingException in project languagetool by languagetool-org.
the class Main method maybeStartServer.
private boolean maybeStartServer() {
Configuration config = ltSupport.getConfig();
if (config.getRunServer()) {
try {
HTTPServerConfig serverConfig = new HTTPServerConfig(config.getServerPort(), false);
httpServer = new HTTPServer(serverConfig, true);
httpServer.run();
if (enableHttpServerItem != null) {
enableHttpServerItem.setState(httpServer.isRunning());
setTrayIcon();
}
} catch (PortBindingException e) {
JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
}
}
return httpServer != null && httpServer.isRunning();
}
Aggregations