Skip to content

Latest commit

 

History

History
65 lines (55 loc) · 3.28 KB

DOCS.md

File metadata and controls

65 lines (55 loc) · 3.28 KB

Functions

followToAdoptium()

The API will decide if it needs to redirect from api.adoptopenjdk.net to api.adoptium.net before finally redirecting to the binary. This function handles the initial redirection if needed, otherwise it just returns the location url for the binary.

install([version], [options])

Installs a JRE copy for the app

followToAdoptium()

The API will decide if it needs to redirect from api.adoptopenjdk.net to api.adoptium.net before finally redirecting to the binary. This function handles the initial redirection if needed, otherwise it just returns the location url for the binary.

Kind: global function

install([version], [options]) ⇒

Installs a JRE copy for the app

Kind: global function
Returns: Promise - Resolves to the installation directory or rejects an error

Param Type Default Description
[version] number 8 Java Version (8/9/10/11/12)
[options] object Installation Options
[options.os] string Operating System (defaults to current) (windows/mac/linux/solaris/aix)
[options.arch] string Architecture (defaults to current) (x64/x32/ppc64/s390x/ppc64le/aarch64/sparcv9)
[options.openjdk_impl] string "hotspot" OpenJDK Implementation (hotspot/openj9)
[options.release] string "latest" Release
[options.type] string "jre" Binary Type (jre/jdk)
[options.heap_size] string Heap Size (normal/large)
[options.vendor] string defaults to adoptopenjdk (adoptopenjdk/eclipse)

Example

const njre = require('njre')

// Use default options
njre.install()
  .then(dir => {
    // Do stuff
  })
  .catch(err => {
    // Handle the error
  })

// or custom ones
njre.install(11, { os: 'aix', arch: 'ppc64', openjdk_impl: 'openj9' })
  .then(dir => {
    // Do stuff
  })
  .catch(err => {
    // Handle the error
  })