How to use @pivotal-tools/jvm-launch-utils - 3 common examples

To help you get started, we’ve selected a few @pivotal-tools/jvm-launch-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spring-projects / sts4 / theia-extensions / theia-commons / src / node / language-server-contribution.ts View on Github external
protected findJvm(javaHome?: string) {
        return this.preferJdk ? findJdk(javaHome) : findJvm(javaHome);
    }
github microsoft / vscode-spring-boot-dashboard / src / Controller.ts View on Github external
public async openBootApp(app: BootApp): Promise {
        let jvm = await findJvm();
        if (!jvm) {
            throw new Error("Couldn't find a JVM to run Java code");
        }
        let jmxport = app.jmxPort;
        if (jmxport) {
            let jmxurl = `service:jmx:rmi:///jndi/rmi://localhost:${jmxport}/jmxrmi`;
            if (jvm) {
                let javaProcess = jvm.jarLaunch(
                    path.resolve(this._context.extensionPath, "lib", "java-extension.jar"),
                    [
                        "-Djmxurl=" + jmxurl
                    ]
                );
                let port = parseInt(await readAll(javaProcess.stdout));
                if (port > 0) {
                    vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(`http://localhost:${port}/`));

@pivotal-tools/jvm-launch-utils

Provides utilities useful for launching Java processes from node packages.

EPL-1.0
Latest version published 2 years ago

Package Health Score

67 / 100
Full package analysis