Run Java samples

Once you have built the Java sample that you wish to run, you can go to the artifact output folder and run the appropriate command. As an example, DocumentClassification might look like this:

java -jar DocumentClassificationSample.jar -service_url=http://yourserver:5002/v3
-input=”../../Sample Images/businessletter1.tif,../../Sample Images/contract1.tif,../../Sample Images/invoice1.tif"
-dcproject=”../../Sample Images/classifier.dcp"
-output=result.xml
-pages=1

If you wish to use the sample input files, then you can write the relative paths as shown above. The current iteration of the Java samples expects a file path that is relative to each sample folder. The DocumentClassificationSample will, for instance, look for files beginning in the main DocumentClassificationSample folder.

The Java samples display a short help overview if any required parameters are missing.