package app;

import java.io.IOException;
import java.net.URI;

import org.glassfish.jersey.jdkhttp.JdkHttpServerFactory;
import org.glassfish.jersey.server.ResourceConfig;

import com.sun.net.httpserver.HttpServer;

public class Server {

    public static void main(String[] args) throws IOException {
        URI uri = URI.create("http://localhost:8080/rest/");

        ResourceConfig rc = new ResourceConfig();
        rc.register(Calc.class);

        HttpServer httpServer = JdkHttpServerFactory.createHttpServer(uri, rc);

        System.out.println("JAX-RS started");
        System.in.read();

        httpServer.stop(0);
    }
}

@@ -523,25 +523,24 @@
 i, rc);%0A
-%0A
         
 System.o
@@ -535,80 +535,61 @@
     
-System.out.println(%22JAX-RS started%22);%0A        System.in.read();%0A%0A       
+Runtime.getRuntime().addShutdownHook(new Thread(() -%3E
  htt
@@ -603,16 +603,18 @@
 .stop(0)
+))
 ;%0A    %7D%0A

停止はCTRL + Cで行う