New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

jdk-utils

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jdk-utils

JDK related utils for Java related development.

latest
Source
npmnpm
Version
0.6.0
Version published
Maintainers
1
Created
Source

node-jdk-utils

NPM version NPM downloads

A collection of Java related utils.

Installation

npm i jdk-utils

Usage

findJavaRuntime

Find Java runtime from all possible locations on your machine. Covering:

  • JAVA_HOME.
  • JDK-like paths from PATH.
  • SDKMAN installation location.
  • jabba installation location, i.e. ~/.jabba/jdk
  • JBang installation location, i.e. ~/.jbang/cache/jdks
  • ASDF installation location.
  • JDK installations managed by Gradle, e.g. ~/.gradle/jdk
  • Links specified in jEnv.
  • Homebrew installation:
    • macOS Intel: /usr/local
    • macOS Apple Silicon: /opt/homebrew
    • Linux: /home/linuxbrew/.linuxbrew
  • Platform-specific conventional installation location:
    • Linux: /usr/lib/jvm
    • macOS: /Library/Java/JavaVirtualMachines, ~/Library/Java/JavaVirtualMachines, output of java_home -V.
    • Windows: JDK-like folders under %ProgramFiles% and %LocalAppData%,

Note: If you want to skip scanning a certain source for better performance, you can specify skipFrom options when calling the API.

CLI

Below command lists all detected JDKs with details.

npx jdk-utils

callback-style

require("jdk-utils").findRuntimes().then(console.log)
/*
[{
    homedir: '/home/username/.sdkman/candidates/java/17.0.1-ms',
  }, {
    homedir: '/usr/lib/jvm/java-11-openjdk-amd64',
  },
...
]
*/

promise-style

import { findRuntimes } from "jdk-utils";
await findRuntimes({checkJavac: true, withVersion: true, withTags: true});
/*
[{
    homedir: '/home/yanzh/.sdkman/candidates/java/17.0.1-ms',
    hasJavac: true,
    isFromSDKMAN: true,
    version: { java_version: '17.0.1', major: 17 }
  }, {
    homedir: '/usr/lib/jvm/java-11-openjdk-amd64',
    hasJavac: true,
    version: { java_version: '11.0.7', major: 11 }
  },
...
]
*/

FAQs

Package last updated on 08 Jul 2025

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