Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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}/`));