Colin747 Colin747 - 4 months ago 79
Linux Question

Cowardly refuses to write to a non-existent directory - JAXB

I'm getting the following error when trying to generate Java classes from an XSD schema using JAXB. I'm specifying a directory that I want them to be in but I am getting the following error when I try to run the command.

Command:

java -jar /home/Alison/Programs/jaxb-ri-2.2.6/lib/jaxb-xjc.jar xmlSchema.xjb -d com.q1labs.qa.xmlgenerator.model.xmlclasses xmlSchema.xsd


Error:

cowardly refuses to write to a non-existent directory "com.q1labs.qa.xmlgenerator.model.xmlclasses"


I found the following patch http://jira.codehaus.org/browse/MJAXB-2 but from the comments it seems that it no longer works with the current revision.

Is there any way I can specify to create the directory if it does not exist?

Answer

Manged to get this to work the way I wanted using the following command:

java -jar /home/Alison/Programs/jaxb-ri-2.2.6/lib/jaxb-xjc.jar -b xmlSchema.xjb -d src -p com.q1labs.qa.xmlgenerator.model.xmlclasses xmlSchema.xsd