Question: I want to write something in Java that would compute something on the fly. So, I want to have a Java server that can reply to AJAX requests. That's all I need. I want it to be as minimalistic as humanly possible.

If you want a hypothetical scenario, pretend I want to write an adder service. Something to which I can pass the JSON: { "action" : "add", "args": [0, 1] } and get { "sum" : 1 } back. That's all, but I want it on the web. I don't care about security or anything else. So no sessions, no https or anything.

I don't want to set up a server or use some bloated framework. I'm thinking I can accomplish this with JNetPCap and pure old Java, but I would like to get rid of PCap as well. 

I guess I'm asking what in the standard JRE or a very light-weight jar can give me what I'm looking for.

Thank you guys.

Edit: For the purpose of the exercise, imagine that what I want to write should be able to run on anything that has Java installed and has an open port. 

Edit #2: It turns out my entire thought process had a fundamental flaw: If I have a server that only serves JSON there's no way to have a page on the same domain that can safely request that JSON without using JSONP or something. So, I will be using the JLHTTP. Thank you all who participated.

Answer: 
[This is](http://www.freeutils.net/source/jlhttp/) the most lightweight functioning HTTP server written in Java that I've come across so far (39 KB for the whole thing). I've used it for doing integration testing, I have no idea how it would fare as a production server. In particular, I don't know how it handles multiple concurrent requests.
You can implement a very basic HTTP server in about a hundred lines of code using Java's nio. I wrote one that I used for a lecture on logging (as a replacement for debug-by-println). It was conceptually similar to your Server.java example, but used the nio packages. Assuming you don't want to write your own, or just want an example, take a look at [Raining Sockets](http://jniosocket.sourceforge.net/). Next, you'll need something to parse the JSON. You can use Gson (no link because my SO reputation isn't high enough), or again, write your own. If you write your own, you may want to use a parser generator tool like [ANTLR](http://www.antlr.org/). ANTLR might also help if you want to support the HTTP specification with a little more rigor than just matching "HTTP GET".