Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

VERSION_FORMAT

VERSION_FORMAT: { FULL: "full"; MAJOR: "major" } = ...

Type declaration

  • FULL: "full"
  • MAJOR: "major"

Functions

getJavaHome

  • getJavaHome(): string
  • getJavaHome(version: string | number): string
  • Locate the java binary

    Returns string

    the path of the java binary

  • Locate the java binary corresponding to the provided version number

    Parameters

    • version: string | number

    Returns string

    the path of the java binary

getVersion

  • getVersion(format: "major", env?: AnyObject): number
  • getVersion(format: "full", env?: AnyObject): string
  • Returns a promise that resolves to the major number of the current installed version of java.

    Parameters

    • format: "major"
    • Optional env: AnyObject

    Returns number

  • Returns a promise that resolves to the full version number string of the currently installed version of java.

    Parameters

    • format: "full"
    • Optional env: AnyObject

    Returns string

Const run

  • run(jar: string, flags?: string[], options?: SpawnOptions): Promise<string> & ChildProcess
  • runs a java .jar file

    Parameters

    • jar: string

      the path to the jar file

    • flags: string[] = []

      any flags to pass to the jar file

    • options: SpawnOptions = {}

      spawn options

    Returns Promise<string> & ChildProcess

    an object combining the child process that was spawned, and a promise that resolves to the string output to stdout.

Generated using TypeDoc