I have a simple project to test JAX-RS services. Yesterday I downloaded jersey-1.7.1 and used com.sun.jersey.api.container.httpserver.HttpServerFactory and com.sun.net.httpserve
You could use the JdkHttpServerFactory, which is available in the jersey-container-jdk-http-2.0.jar:
ResourceConfig rc = new ResourceConfig(HelloWorldResource.class); HttpServer server = JdkHttpServerFactory.createHttpServer(baseUri, rc);
No need to call server.start()!