Monday, October 23, 2006

Playing with JAXB

I am going through JAXB tutorial and there are some loopholes that I had to jump over in order to make it work.

For example, here it gives not correct commands for compiling and running the primer.

The correct commands (provided that you've installed JWSDP in C:\Sun\jwsdp-2.0) are the following (you should be able to easily rewrite them with using environment variables instead of absolute paths):



Note the differences from tutorials' commands:
a) putting double quotes around %JAVA_HOME%\bin\javac because JDK is by default gets installed to c:\\Program Files\Java... which has white space in it
b) providing the classpath to the JAXB libraries (I don't know yet which ones of them are truly needed for this exactly exercise, I will learn it later)
c) in compiling I removed the primer\po\impl path - I don't know why it's there now (maybe for other examples?)
d) I copied the to the root forlder for this example from src folder

The output of this exercise is what was expected:

Very good! This exercise created Java classes from po.xsd and then it read the po.xml to these classes.

So far so good. Let's see what's next in JAXB goodies chest.

No comments: