well you need to get GSON, so you create json in java, then you probably want to install tomcat, and then learn to program servlets. Or the hacky way use jetty and you can just extend the server part and just make it return json using GSON
This is pretty standard now, especially since Jetty is very common for HTTP stuff in Android applications, etc. Not just desktop/server applications.