Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get xjc?

Tags:

java

xml

xjc

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.

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

like image 387
Ross Aiken Avatar asked Apr 04 '12 05:04

Ross Aiken


People also ask

Where is XJC?

Run the JAXB schema compiler, xjc command from the directory where the schema file is located. The xjc schema compiler tool is located in the app_server_root \bin\ directory. Use the generated JAXB objects within a Java application to manipulate XML content through the generated JAXB classes.

What is XJC command?

Use the Java™ Architecture for XML Binding (JAXB) tools to generate Java classes from an XML schema with the xjc schema compiler tool.

What is XJC file?

XJC is a Java SE tool that compiles an XML schema file into fully annotated Java classes. It is distributed within the JDK package and is located at /bin/xjc path.

Which component or tool in JAXB can generate Java files from schemas?

After the Java artifacts for your application are generated, you can generate fully annotated Java classes from an XML schema file by using the JAXB schema compiler, xjc command-line tool.


2 Answers

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.

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

like image 87
Jan Bodnar Avatar answered Oct 02 '22 13:10

Jan Bodnar


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.

like image 34
emory Avatar answered Oct 02 '22 12:10

emory