Skip to content

Running the Examples

Kim Coleman edited this page Mar 10, 2015 · 8 revisions

UNDER CONSTRUCTION

The Java Client API source includes several packages containing examples under com.marklogic.client.example. The examples drawn on scripts and other resources in src/main/resources/.

Building and Running the Examples in Eclipse

Use these instructions to run the examples when working with Java Client API sources in the Eclipse IDE.

  1. Follow the instructions on the wiki for setting up a Java Client API project in Eclipse.
  2. Modify your copy of src/main/resources/Example.properties to match your MarkLogic connection information, as described in src/main/resources/example/README.txt.
  3. To run an example, right-click on it in the Package Explorer and select Run As...Java Application. Note that some of the Cookbook examples (com.marklogic.client.example.cookbook) depend on one another, so the order in which you run them matters. For example, DocumentRead.java assumes DocumentWrite.java has already run. See AllCookbookExamples.java for a safe ordering.

Running the Examples from the ZIP file

Use these instructions to run the examples when working with a pre-built Java Client API library, such as the ZIP file available from developer.marklogic.com. The examples are included in the pre-built JAR.

  1. Download and unzip the Java Client API library package to a location of your choice.
  2. Ensure that you have a compatible Java JRE on your path.
  3. Modify java-client-api-version/example/Example.properties to match your MarkLogic connection information, as described in java-client-api-version/example/README.txt.
  4. Run one of the examples listed in the README by...
Clone this wiki locally