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
How do I get xjc?
提问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 bin
directory in the ZIP file where we can find the xjc
and schemagen
tools.
请注意,从 Java 11 开始,JAXB 已从 JDK 中删除。它必须单独安装。bin
ZIP 文件中有一个目录,我们可以在其中找到xjc
和schemagen
工具。
Download link: https://javaee.github.io/jaxb-v2/
回答by barsju
Its part of the JDK. Check your Java bin folder.
它是JDK的一部分。检查您的 Java bin 文件夹。