Skip to content

Commit

Permalink
Fix build on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Snjezana Peco <[email protected]>
  • Loading branch information
snjeza committed May 2, 2019
1 parent 5bc3ebc commit d371309
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/javaServerStarter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ export function prepareExecutable(requirements: RequirementsData, workspacePath,
const options: ExecutableOptions = Object.create(null);
options.env = process.env;
options.stdio = 'pipe';
if (os.platform() === 'win32') {
const vmargs = javaConfig.get('jdt.ls.vmargs', '');
const watchParentProcess = '-DwatchParentProcess=';
if (vmargs.indexOf(watchParentProcess) >= 0) {
options.detached = true;
}
}
executable.options = options;
executable.command = path.resolve(requirements.java_home + '/bin/java');
executable.args = prepareParams(requirements, javaConfig, workspacePath);
Expand Down Expand Up @@ -68,7 +75,7 @@ function prepareParams(requirements: RequirementsData, javaConfiguration, worksp
if (os.platform() === 'win32') {
const watchParentProcess = '-DwatchParentProcess=';
if (vmargs.indexOf(watchParentProcess) < 0) {
params.push(watchParentProcess + 'false');
params.push(watchParentProcess + '0');
}
}

Expand Down

0 comments on commit d371309

Please sign in to comment.