From 00a5f268e493e8980c0ed32ffd11bdb1bb2adacd Mon Sep 17 00:00:00 2001 From: Rod-Christensen <98939082+Rod-Christensen@users.noreply.github.com> Date: Mon, 14 Feb 2022 10:09:05 -0800 Subject: [PATCH 1/2] Add check to determine if javaExec is specified in the launch configuration --- src/configurationProvider.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/configurationProvider.ts b/src/configurationProvider.ts index 9661c9c3..df7ea5e8 100644 --- a/src/configurationProvider.ts +++ b/src/configurationProvider.ts @@ -284,8 +284,10 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration }); } - config.javaExec = await lsPlugin.resolveJavaExecutable(config.mainClass, config.projectName); - // Add the default launch options to the config. + if (!config.javaExec) + config.javaExec = await lsPlugin.resolveJavaExecutable(config.mainClass, config.projectName); + + // Add the default launch options to the config. config.cwd = config.cwd || _.get(folder, "uri.fsPath"); if (Array.isArray(config.args)) { config.args = this.concatArgs(config.args); From db9e6763e64ab65e555c81de202c6206e628b54d Mon Sep 17 00:00:00 2001 From: Rod-Christensen <98939082+Rod-Christensen@users.noreply.github.com> Date: Tue, 15 Feb 2022 08:15:57 -0800 Subject: [PATCH 2/2] Hopefully corrected lint error --- src/configurationProvider.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/configurationProvider.ts b/src/configurationProvider.ts index df7ea5e8..3acd76c4 100644 --- a/src/configurationProvider.ts +++ b/src/configurationProvider.ts @@ -284,8 +284,10 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration }); } - if (!config.javaExec) + // If not provided in the launch config, resolve the java executable + if (!config.javaExec) { config.javaExec = await lsPlugin.resolveJavaExecutable(config.mainClass, config.projectName); + } // Add the default launch options to the config. config.cwd = config.cwd || _.get(folder, "uri.fsPath");