Installation

Prerequisites

  • Node.js 20 LTS or later
  • JDK 8 or later (17 LTS recommended) with JAVA_HOME set
  • Native build tools for node-gyp

See System Requirements for details.

Install from npm

GroupDocs.Assembly for Node.js via Java is published on npm as @groupdocs/groupdocs.assembly. Install it into your project:

npm install @groupdocs/groupdocs.assembly

During installation npm:

  1. Builds the java bridge package, which lets Node.js call the Java API.
  2. Runs the package’s postinstall script, which downloads the GroupDocs.Assembly JAR file (groupdocs-assembly-nodejs-<version>.jar) into node_modules/@groupdocs/groupdocs.assembly/lib/.

Verify installation

Create a file named check.js:

'use strict';

const groupdocs = require('@groupdocs/groupdocs.assembly');

const assembler = new groupdocs.DocumentAssembler();
console.log('GroupDocs.Assembly loaded:', assembler !== undefined);

process.exit(0);

Run it:

node check.js
Note
GroupDocs.Assembly runs inside a Java virtual machine started by the java bridge, and the JVM keeps the Node.js process alive after your code finishes. Call process.exit() at the end of standalone scripts.

Download the JAR file manually

If the postinstall step cannot download the JAR file (for example, behind a corporate proxy), the package prints a warning when you load it. Download the file again from the package folder:

cd node_modules/@groupdocs/groupdocs.assembly
npm run postinstall

Or download groupdocs-assembly-nodejs-<version>.jar from https://releases.groupdocs.com/java/repo/com/groupdocs/groupdocs-assembly-nodejs/<version>/ and place it in node_modules/@groupdocs/groupdocs.assembly/lib/.

Troubleshooting

  • node-gyp build errors: install the build tools listed in System Requirements, restart the terminal and run npm install again.
  • jni.h not found: a JRE is installed instead of a JDK, or JAVA_HOME points to the wrong folder.
  • Java not found at runtime: set JAVA_HOME and add JAVA_HOME/bin to PATH.
  • The script does not exit: add process.exit() at the end of the script.
  • Can not resolve method on Java 16 or later: call require('java').options.push('--add-opens=java.base/java.lang=ALL-UNNAMED') before requiring @groupdocs/groupdocs.assembly. See System Requirements.
  • Permission errors when writing reports: make sure the process can write to the output folder.
Close
Loading

Analyzing your prompt, please hold on...

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