# node-java-connector

> enables platform independent java support

Latest version **1.1.2** (published 2026-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-java-connector
pnpm add node-java-connector
yarn add node-java-connector
bun add node-java-connector
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2026-02-23 |
| First published | 2020-01-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 5 |
| Unpacked size | 31.8 KB |
| Known vulnerabilities | 0 (+12 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Nico Lueg |
| Maintainers | nico.lueg |
| Keywords | java, jre, node, jar |

## Links

- npm: https://www.npmjs.com/package/node-java-connector
- Repository: https://github.com/NLueg/node-java-connector
- Homepage: https://github.com/NLueg/node-java-connector#readme
- Issues: https://github.com/NLueg/node-java-connector/issues
- npm.io page: https://npm.io/package/node-java-connector

## Dependencies (5)

- [tar](https://npm.io/package/tar.md) ^6.1.11
- [yauzl](https://npm.io/package/yauzl.md) ^2.10.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.6
- [typescript](https://npm.io/package/typescript.md) ^4.5.5
- [find-java-home](https://npm.io/package/find-java-home.md) ^1.2.2

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2026-02-23
- 1.1.1 — 2022-01-21
- 1.1.0 — 2022-01-21
- 1.0.1 — 2021-12-27
- 1.0.0 — 2021-12-27
- 0.2.1 — 2021-08-06
- 0.2.0 — 2021-07-26
- 0.1.5 — 2021-04-09
- 0.1.4 — 2020-10-05
- 0.1.3 — 2020-01-26
- 0.1.2 — 2020-01-24
- 0.1.1 — 2020-01-14
- 0.1.0 — 2020-01-14
- 0.0.2 — 2020-01-14
- 0.0.1 — 2020-01-14

## README

# node-java-connector

[![npm version](https://badge.fury.io/js/node-java-connector.svg)](https://badge.fury.io/js/node-java-connector)
![npm bundle size](https://img.shields.io/bundlephobia/minzip/node-java-connector)

This package helps with running JAR-Files from JavaScript.
If no Java is installed on the system, a openJDK version will be installed temporarily.

An example can be found at https://github.com/NLueg/node-java-connector-example.

## Getting Started

1. Install the package:

```sh
npm install node-java-connector
```

2. Define a file like `install.js` where you deal with installing the JRE with the following content:

```js
const njb = require("node-java-connector");

njb
  .install()
  .then((dir) => {
    // do something with the directory
  })
  .catch((err) => {
    console.log(err);
  });
```

3. Add the script to your `package.json` that the JRE gets installed everytime when your package gets installed:

```json
{
 ...
 "scripts": {
 "install": "node install.js",
 }
 ...
}
```

4. Use the `executeJar` method with the path to your JAR-file and optional arguments or `executeClassWithCP` for non-executable JARs.

---
_Source: https://npm.io/package/node-java-connector · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
