0.1.4 • Published 4 years ago

@xmcl/java-installer v0.1.4

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

Installer Module

npm version Downloads Install size npm Build Status

Provide functions to install jaav from Minecraft source.

Usage

Install Java 8 From Mojang Source

Scan java installation path from the disk. (Require a lzma unpacker, like 7zip-bin or lzma-native)

    import { JavaInstaller } from "@xmcl/java-installer";

    // this require a unpackLZMA util to work
    // you can use `7zip-bin`
    // or `lzma-native` for this
    const unpackLZMA: (src: string, dest: string) => Promise<void>;

    await JavaInstaller.installJreFromMojang({
        destination: "your/java/home",
        unpackLZMA,
    });

Scan Local Java

This will scan the paths in arguments and some common places to install java in current os.

So passing an empty array is OK.

    import { JavaInstaller, JavaInfo } from "@xmcl/java-installer";

    const validJavaList: JavaInfo[] = await JavaInstaller.scanLocalJava([
        "my/java/home"
    ]);

    // it can parse java major version, like `8` or `10`
    const javaMajorVersion: number = validJavaList[0].majorVersion;

    // also the java version
    const javaVersion: string = validJavaList[0].version;

    // also contain the path
    const jPath: string = validJavaList[0].path;
0.1.4

4 years ago

0.1.2

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.4-alpha.1

4 years ago

0.0.4-alpha.0

4 years ago

0.0.3-alpha.0

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago