java 我如何获得 xjc?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10005632/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 23:13:47  来源:igfitidea点击:

How do I get xjc?

javaxmlxjc

提问by Ross Aiken

So I've been looking at interfacing with xml files for a project I've been working on, and one of the things I want to do is generate java classes from a .dtd file. After some searching, I found out that xjc should be able to do what I want, but I cannot for the life of me find out where to get the program itself.

所以我一直在寻找与我一直在从事的项目的 xml 文件的接口,我想做的一件事是从 .dtd 文件生成 java 类。经过一番搜索,我发现 xjc 应该能够做我想做的事,但我一生都无法找到程序本身的来源。

I feel like the answer is sitting right in front of me, but my google-fu is really failing me hardcore right now...

我觉得答案就在我面前,但我的 google-fu 现在真的让我失望了......

采纳答案by emory

I got it when I installed java. It is probably on your system right now. Look in the directory where java, javac, etc are located.

我在安装java时得到了它。它现在可能在您的系统上。查看java、javac等所在目录。

回答by Jan Bodnar

Note that since Java 11, the JAXB was removed from the JDK. It has to be separately installed. There is a bindirectory in the ZIP file where we can find the xjcand schemagentools.

请注意,从 Java 11 开始,JAXB 已从 JDK 中删除。它必须单独安装。binZIP 文件中有一个目录,我们可以在其中找到xjcschemagen工具。

Download link: https://javaee.github.io/jaxb-v2/

下载链接:https: //javaee.github.io/jaxb-v2/

回答by barsju

Its part of the JDK. Check your Java bin folder.

它是JDK的一部分。检查您的 Java bin 文件夹。

回答by apesa

xjc is a tool in JAXB which is in Java SE, Java EE and Java Web Services and i'm sure many more. Read up on JAXBHere

xjc 是 JAXB 中的一个工具,它位于 Java SE、Java EE 和 Java Web 服务中,我相信还有更多。在这里阅读JAXB