diff --git a/src/configurationProvider.ts b/src/configurationProvider.ts index 9661c9c3..3acd76c4 100644 --- a/src/configurationProvider.ts +++ b/src/configurationProvider.ts @@ -284,8 +284,12 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration }); } - config.javaExec = await lsPlugin.resolveJavaExecutable(config.mainClass, config.projectName); - // Add the default launch options to the config. + // 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"); if (Array.isArray(config.args)) { config.args = this.concatArgs(config.args);