Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAXB download/tutorial

 
Mike London
Ranch Hand
Posts: 1185
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Having been away from JAXB for a couple years, I find that I have a couple questions:

1. In an XML book I have, it says I need to download the entire developer pack from Sun, yet other sites linked to from JR just point to a JAR file. Does this JAXB jar file contain the schema compiler too (xjc)?

Is this JAR file all I need?

2. Any suggestions on the most straight-forward JAXB (getting back up to speed) tutorial?

Thanks very much in advance.

-- Mike
 
Uday Kulkarni
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mike

Please go to this link to learn basics of JAXB
http://java.sun.com/webservices/docs/1.5/tutorial/doc/JAXBWorks2.html

In short JAXB generates Java classes for the XMl schema. And allows you to read XML and deserialise/unmarshal into Java objects and vice versa.

You can get jaxb packaged into JWSDP2.0 available at
http://java.sun.com/webservices/downloads/previous/webservicespack.jsp

after you install/unpack the JWSDP pack you will get folders, jaxb,jaxp,jaxrpc folders in the root directory of JWSDp.

To generate java classes for your schema run the following command .offcourse after setting JAXB_HOME and JAVA_HOME environmental variables.


xjc -extension -d c:\tmp\src -p com.abc.demo c:\tmp\abc.xsd

c:\tmp\src is location where all java classes will be generated.
c:\tmp\abc.xsd is yuor schema



Hope this information helps you

Cheers
Uday

Mike London wrote:Having been away from JAXB for a couple years, I find that I have a couple questions:

1. In an XML book I have, it says I need to download the entire developer pack from Sun, yet other sites linked to from JR just point to a JAR file. Does this JAXB jar file contain the schema compiler too (xjc)?

Is this JAR file all I need?

2. Any suggestions on the most straight-forward JAXB (getting back up to speed) tutorial?

Thanks very much in advance.

-- Mike
 
Mike London
Ranch Hand
Posts: 1185
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic