Below is the code to start Grizzly Http Server. If I press any key the server stops. Is there any way to keep it alive.
Jetty has join() method, which will not exit
Try something like:
try { server.start(); Thread.currentThread().join(); } catch (Exception ioe) { System.err.println(ioe); } finally { try { server.stop(); } catch (IOException ioe) { System.err.println(ioe); } }