Last article I created a XML Schema to use in my example program. I created an XML file that would represent the file structure. My next step in developing my example application is to run JaxB to create a series of Java classes to create the XML file.
The JaxB implementation I used was part of the Java Web Services Developer Pack 2.0, which I installed to directory C:\Sun\jwsdp-2.0
Once installed, I set the following environment variables:
PATH= (Added) C:\Sun\jwsdp-2.0\jwsdp-shared\bin; C:\Sun\jwsdp-2.0\jaxb\bin\
Now, I can compile XML schemas from the command line by using the XJC.BAT command. Since I had created a Java project already containing the schema, I needed to use a command prompt to change to that directory and run XJC against the resulting .XSD file created by the Web Tools Project XML Schema designer. In order to do that and create the Java classes, I run the following commands, where C:\WTP is the location of my Eclipse installation, C:\WTP\WORKSPACE is the location of my workspace and project files.
xjc.bat –p com.digiassn.blogspot.filestructure FileStructure.xsd
That’s it, the following files were created from the above commands:
And next article, I will wrap this up and show the completed application.