A common approach is to use the XSLT-based process described on the Schematron web site at http://schematron.com/front-page/the-schematron-skeleton-implementation/ .
The process transforms the Schematron schema into an XSL document, then uses that XSL document to transform the document you are trying to validate. The end result is an SVRL (Schematron Validation Report Language) document that describes any validation issues found.
A shell script process would look like this:
To transform the Schematron schema into XSL:
xslt -stylesheet iso_dsdl_include.xsl theSchema.sch > theSchema1.sch
xslt -stylesheet iso_abstract_expand.xsl theSchema1.sch > theSchema2.sch
xslt -stylesheet iso_svrl_for_xsltn.xsl theSchema2.sch > theSchema.xsl
To validate an XML document:
xslt -stylesheet theSchema.xsl myDocument.xml > myResult.xml
The process could be done in Java using an XSLT library. If your Schematron schema uses XSLT2/Xpath 2, then I would recommend using the Saxon XSLT library.