How do you invoke schemagen in Java 11?

前端 未结 3 1834
渐次进展
渐次进展 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:56

    If trying to use the schemagen in the jaxb-ri download directly, note the JAXB_PATH in schemagen.bat is inconsistent with the mod directory in the jaxb-ri.zip file.

    E.g. to use schemagen.bat:

    • As at now, download jaxb-ri-2.3.1.zip from https://maven.java.net/content/repositories/releases/com/sun/xml/bind/jaxb-ri/2.3.1/ (the 2.4.0-betas also had the mod/javax.activation-api.jar missing)

    • Use these steps to run schemagen.bat, setting JAXB_HOME as appropriate:

           set JAXB_HOME=C:\Java\jaxb-ri-2.3.1
           set CLASSPATH=%JAXB_HOME%/mod/relaxng-datatype.jar;%JAXB_HOME%/mod/javax.activation-api.jar
           %JAXB_HOME%\bin\schemagen.bat -cp myjar1.jar;myjar2.jar -d target com.company.ClassName1 com.company.ClassName2
      

    (This was against JDK 11)

提交回复
热议问题