Java tutorial
import java.io.IOException; import javax.xml.bind.JAXBContext; import javax.xml.bind.SchemaOutputResolver; import javax.xml.transform.Result; import javax.xml.transform.stream.StreamResult; public class Main { public static void main(String[] args) throws Exception { JAXBContext jc = JAXBContext.newInstance(Main.class); jc.generateSchema(new SchemaOutputResolver() { @Override public Result createOutput(String namespaceURI, String suggestedFileName) throws IOException { System.out.println(suggestedFileName); return new StreamResult(suggestedFileName); } }); } }