How do you invoke schemagen in Java 11?

前端 未结 3 1830
渐次进展
渐次进展 2021-02-09 17:25

According to Oracle documentation the schemagen tool is removed from the JDK as part of JEP 320 (http://openjdk.java.net/jeps/320). That JEP points to Maven artifacts that now s

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-09 17:50

    Schemagen and xjc shell scripts are only put into binary distribution in ./bin directory.

    For build tools there are plugins out there (Maven / Gradle) which does invoke schemagen and xjc APIs, providing user with simple configuration.

    Your attempt to invoke com.sun.tools.jxc.SchemaGeneratorFacade manually is also correct, here is similar example for Maven. However you are probably putting 2.3.0 on module path, which has a split package problem. Putting on classpath will resolve the issue for 2.3.0. Next release of JAXB will be JPMS ready and have module descriptors declared. You can try the beta build (2.4.0-b180725.0644), here is a correct set of dependencies:

    
      org.glassfish.jaxb
      jaxb-runtime 
    
    
    
      org.glassfish.jaxb
      jaxb-xjc 
    
    
    
      org.glassfish.jaxb
      jaxb-jxc 
    
    

提交回复
热议问题