You can write a servlet which you will access using a browser. HTML page for control of functionality should include buttons (links) like run, stop, check and so on for your service. Servlet uses method doGet instead of main. A request can have parameters you normally get in main as well. doGet will be called one you click above command links.