in environment-fetcher-agent/src/jetbrains/buildserver/environmentFetcher/agent/EnvironmentFetcherService.java [31:55]
public String generateCmdLine() {
final StringBuilder buf = new StringBuilder();
// java executable path
buf.append("\"");
buf.append(System.getProperty("java.home")).append(File.separator);
buf.append("bin").append(File.separator).append(SystemInfo.isWindows ? "java.exe" : "java");
buf.append("\"");
// -jar option
buf.append(" -jar ");
// jar file path
final String thisJarPath = PathUtil.getJarPathForClass(EnvironmentFetcherService.class);
final String pluginLibDir = PathUtil.getParentPath(thisJarPath);
final String pluginHomeDir = PathUtil.getParentPath(pluginLibDir);
buf.append("\"");
buf.append(pluginHomeDir).append(File.separatorChar)
.append("bin").append(File.separatorChar)
.append("env-fetcher.jar");
buf.append("\"");
return buf.toString();
}