title: Hosting a JSON REST Web Service in a standalone Java Console Application
body: <p>Using WCF, it's possible to create a self-hosted console application which accepts REST requests and responds with JSON content.</p>
  
  <p>Is there a way to do the same in Java, noting that I'd like it to be completely contained in the one console application (with no use of web servers such as Tomcat)? It would also be nice if it doesn't depend on external libraries.</p>
  
  <p><a href="https://stackoverflow.com/questions/5595028/add-a-web-service-to-a-already-available-java-project">This example</a> shows how to set up a self-hosting SOAP web service, but not REST.</p>