Search code examples
jax-wsjava-7aptjava-6wsgen

How to use javac to replace deprecated wsgen or apt in JDK 7 or 6?


When I use wsgen or apt to generate web service artifacts in JDK 7 with command.

wsgen -s src -cp CLASS_PATH -d OUTPUT_DIRECTORY  com.sun.WebServiceSEI

displays following warning message

The apt tool and its associated API contained in the package com.sun.mirror have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the javac tool and the APIs contained in the packages javax.annotation.processing and javax.lang.model to process annotations.

How can I generate web service artifacts without using wsgen or apt to remove this warning?


Solution

  • The warning is generated because WsgenTool class is using classes from com.sun.mirror.apt package, which seem to be deprecated in JDK7. I think in a while JAX-WS team will release jaxws-ri which does not use this API, but it may happen somewhere closer to JDK8 release.