How do you invoke schemagen in Java 11?

前端 未结 3 1169
时光取名叫无心
时光取名叫无心 2021-02-09 17:03

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:54

    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)

提交回复
热议问题