package javax.jws does not exist

I am trying to implement soap web service by using Java. It is showing package javax.jws does not exist. I have added the path to jdk also. I am new to Java, please help me.

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@WebService
@SOAPBinding(style=SOAPBinding.Style.RPC)
public class Hello {
    public String sayHello(String name) {
        return "Hello " + name;
    }
}

Solution 1:

Please read the java 9 migration guide. Or see Replacements for deprecated JPMS modules with Java EE APIs.

Short version: use the reference implementation of JAX-WS.

<dependency>
  <groupId>com.sun.xml.ws</groupId>
  <artifactId>jaxws-ri</artifactId>
  <version>2.3.0</version>
  <type>pom</type>
</dependency>