How to Run Examples

Prerequisites

Before running the examples, ensure you have:

  • Java JDK 8 or later (JDK 17 LTS recommended) - See System Requirements
  • Maven 3.6 or later - For building and running examples
  • Git - To clone the repository (optional)

Getting the Examples

Option 1: Clone from GitHub

Clone the repository to your local machine:

git clone https://github.com/groupdocs-redaction/GroupDocs.Redaction-for-Java.git
cd GroupDocs.Redaction-for-Java

Option 2: Download ZIP

Download the repository as a ZIP file from GitHub and extract it.

Installation

Navigate to the Examples directory and install dependencies:

cd Examples
mvn clean install

This command will:

  • Download the GroupDocs.Redaction library and all required dependencies
  • Compile all example classes
  • Prepare the project for execution

Running All Examples

Execute all examples using Maven:

cd Examples
mvn compile exec:java

This will run all examples sequentially. Output files are saved to target/Output/<example-name>/.

Output Location

All example outputs are saved to:

Examples/target/Output/<example-name>/

For example:

  • HelloWorld example → target/Output/HelloWorld/
  • ApplyRedaction example → target/Output/ApplyRedaction/

Troubleshooting

Maven Build Errors

If dependencies fail to download:

# Clean and rebuild
mvn clean install -U

Java Version Issues

Ensure you’re using Java 8 or later:

java -version
javac -version

Set JAVA_HOME environment variable if needed.

Missing Sample Files

Ensure all sample files are present in Examples/Resources/SampleFiles/. If files are missing, examples may fail.

License Warnings

Examples run in trial mode by default. To remove license warnings:

  1. Get a temporary license from GroupDocs
  2. Update Constants.java with your license path
  3. Run SetLicenseFromFile example

Repository

View the complete source code and examples on GitHub:

https://github.com/groupdocs-redaction/GroupDocs.Redaction-for-Java

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.