Socket
Book a DemoInstallSign in
Socket

node-java-connector

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-java-connector

enables platform independent java support

1.1.1
latest
Source
npmnpm
Version published
Weekly downloads
2.6K
-7.93%
Maintainers
1
Weekly downloads
 
Created
Source

node-java-connector

npm version npm bundle size

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

  • Install the package:
npm install node-java-connector
  • Define a file like install.js where you deal with installing the JRE with the following content:
const njb = require("node-java-connector");

njb
  .install()
  .then((dir) => {
    // do something with the directory
  })
  .catch((err) => {
    console.log(err);
  });
  • Add the script to your package.json that the JRE gets installed everytime when your package gets installed:
{
 ...
 "scripts": {
 "install": "node install.js",
 }
 ...
}
  • Use the executeJar method with the path to your JAR-file and optional arguments or executeClassWithCP for non-executable JARs.

Keywords

java

FAQs

Package last updated on 21 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.