The schema generator creates a schema file for each name space referenced in your Java classes. Currently, you cannot control the name of the generated schema files. To control the schema file names, see Using SchemaGen with Ant at http://jaxb.java.net/nonav/2.2.3u1/docs/schemagenTask.html
Start the schema generator with the appropriate schemagen shell script in the bin directory for your platform. The current schema generator can process either Java source files or class files.
schemagen.sh Foo.java Bar.java ...
Note: Writing schema1.xsd
If your java files reference other classes, then those classes must be accessible on your system CLASSPATH environment variable, or they need to be specified in the schemagen command line with the class path options. See Options. If the referenced files are not accessible or specified, then you get errors when you generate the schema.