aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-process/src
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-07-18 11:31:35 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-07-18 11:31:35 +0200
commit894ba986e7ae960baa2b7f3c7bfae4127fd4e700 (patch)
tree0fd7ddec502c4c91e434e0e124b93f005c2ede4a /server/sonar-process/src
parent1fcbbec8d7675e46d2178bb6ff858ab0cbcf4466 (diff)
downloadsonarqube-894ba986e7ae960baa2b7f3c7bfae4127fd4e700.tar.gz
sonarqube-894ba986e7ae960baa2b7f3c7bfae4127fd4e700.zip
SONAR-4898 - Using parent JVM in processWrapper
Diffstat (limited to 'server/sonar-process/src')
-rw-r--r--server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java b/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java
index eeb10b72bf3..eddbded641b 100644
--- a/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java
+++ b/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java
@@ -129,14 +129,17 @@ public class ProcessWrapper extends Thread {
public java.lang.Process executeProcess() {
LOGGER.info("ProcessWrapper::executeProcess() START");
+ String separator = System.getProperty("file.separator");
+ String path = System.getProperty("java.home")
+ + separator + "bin" + separator + "java";
ProcessBuilder processBuilder =
- new ProcessBuilder("java",
+ new ProcessBuilder(path,
"-Dcom.sun.management.jmxremote",
"-Dcom.sun.management.jmxremote.port=" + port,
"-Dcom.sun.management.jmxremote.authenticate=false",
"-Dcom.sun.management.jmxremote.ssl=false",
"-cp",
- StringUtils.join(classPath, ":"),
+ StringUtils.join(classPath, separator),
className);
processBuilder.environment().putAll(properties);
processBuilder.environment().put(Process.SONAR_HOME, workDir);
@@ -153,9 +156,9 @@ public class ProcessWrapper extends Thread {
try {
LOGGER.debug("ProcessWrapper::executeProcess() -- Starting process with command '{}'",
- StringUtils.join(processBuilder.command()," "));
+ StringUtils.join(processBuilder.command(), " "));
java.lang.Process process = processBuilder.start();
- LOGGER.debug("ProcessWrapper::executeProcess() -- Process started: {}",process.toString());
+ LOGGER.debug("ProcessWrapper::executeProcess() -- Process started: {}", process.toString());
errorGobbler = new StreamGobbler(process.getErrorStream(), this.getName() + "-ERROR");
outputGobbler = new StreamGobbler(process.getInputStream(), this.getName());
outputGobbler.start();