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

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

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

displays the following warning message

The apt tool and its associated API contained in the com.sun.mirror package are deprecated after JDK 7 and are planned for removal in the next major version of the JDK. Use the options available in the javac tool and the APIs contained in the javax.annotation.processing and javax.lang.model packages to process annotations.

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

+5
source share
3 answers

, WsgenTool com.sun.mirror.apt, , , JDK7. , JAX-WS jaxws-ri, API, - JDK8.

+1

javac . javac (JSR 269: Pluggable Annotation Processing API) (Java 6, ). , , jaxws-tools.jar(Metro). , , javac -processor com.sun.tools.ws.processor.modeler.annotation.WebServiceAp. Ant, com.sun.tools.ws.ant.AnnotationProcessingTask. http://jax-ws.java.net/nonav/2.2.6/docs/ch04.html#tools-annotation-processing, . , JDK, , .

+2

I fear it is impossible. What you can do is switch to the old JDK that worked for you, this is your best bet.

0
source

All Articles