com.sun.tools.apt.main.CommandLine.parse(CommandLine.java:42)官方解释
http://bugs./view_bug.do;jsessionid=e9d905c1f0f588ffffffffa3149dc97319886?bug_id=6510966 we tried to generate a XML schema out of our existing domain model by using the JAXB (2.1, JDK 1.6.0_07) schemagen.
Trying to launch the schemagen as described in the tutorial caused the following error:
C:\temp>schemagen Example.java An exception has occurred in apt (1.6.0_07). Please file a bug at the Java Developer Connection (http://java./webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you. java.lang.NullPointerException at com.sun.tools.apt.main.CommandLine.parse(CommandLine.java:42) at com.sun.tools.apt.main.Main.compile(Main.java:775) at com.sun.tools.apt.Main.processing(Main.java:95) at com.sun.tools.apt.Main.process(Main.java:85) at com.sun.tools.apt.Main.process(Main.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.tools.internal.jxc.SchemaGenerator$Runner.main(SchemaGenerator.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.tools.internal.jxc.SchemaGenerator.run(SchemaGenerator.java:128) at com.sun.tools.internal.jxc.SchemaGenerator.run(SchemaGenerator.java:38) at com.sun.tools.internal.jxc.SchemaGenerator.main(SchemaGenerator.java:30) After some researching we determined, that the tools.jar needs to be explicitly added to the classpath:
|
|