Easier running for boot-java-ls from runtime workbench

This commit is contained in:
Kris De Volder
2018-01-04 14:06:50 -08:00
parent 95f0c471c1
commit 38f1b64247

View File

@@ -49,10 +49,6 @@ public class SpringBootJavaLanguageServer extends STS4LanguageServerProcessStrea
}
protected String getLanguageServerJARLocation() {
String fromSysprop = System.getProperty("boot-java-ls-jar", null);
if (fromSysprop!=null) {
return fromSysprop;
}
String languageServer = "boot-java-language-server-" + Constants.LANGUAGE_SERVER_VERSION;
Bundle bundle = Platform.getBundle(Constants.PLUGIN_ID);
@@ -69,7 +65,16 @@ public class SpringBootJavaLanguageServer extends STS4LanguageServerProcessStrea
e.printStackTrace();
}
}
if (!dataFile.exists()) {
File userHome = new File(System.getProperty("user.home"));
File locallyBuiltJar = new File(
userHome,
"git/sts4/headless-services/boot-java-language-server/target/boot-java-language-server-"+Constants.LANGUAGE_SERVER_VERSION
);
if (locallyBuiltJar.exists()) {
return locallyBuiltJar.getAbsolutePath();
}
}
return dataFile.getAbsolutePath();
}