incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1414230 - /sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/jarexec/JarExecutor.java
Date Tue, 27 Nov 2012 15:42:15 GMT
Author: bdelacretaz
Date: Tue Nov 27 15:42:14 2012
New Revision: 1414230

URL: http://svn.apache.org/viewvc?rev=1414230&view=rev
Log:
SLING-2682 - use java.home in JarExecutor

Modified:
    sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/jarexec/JarExecutor.java

Modified: sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/jarexec/JarExecutor.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/jarexec/JarExecutor.java?rev=1414230&r1=1414229&r2=1414230&view=diff
==============================================================================
--- sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/jarexec/JarExecutor.java
(original)
+++ sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/jarexec/JarExecutor.java
Tue Nov 27 15:42:14 2012
@@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
  */
 public class JarExecutor {
     private final File jarToExecute;
-    private final String javaExecutable;
+    private final String jvmFullPath;
     private final int serverPort;
     private final Properties config;
     private Executor executor;
@@ -84,7 +84,8 @@ public class JarExecutor {
         String portStr = config.getProperty(PROP_SERVER_PORT);
         serverPort = portStr == null ? DEFAULT_PORT : Integer.valueOf(portStr);
 
-        javaExecutable = isWindows ? "java.exe" : "java";
+        final String javaExecutable = isWindows ? "java.exe" : "java";
+        jvmFullPath = System.getProperty( "java.home" ) + File.separator + "bin" + File.separator
+ javaExecutable;
 
         String jarFolderPath = config.getProperty(PROP_JAR_FOLDER);
         jarFolderPath = jarFolderPath == null ? DEFAULT_JAR_FOLDER : jarFolderPath;
@@ -133,7 +134,7 @@ public class JarExecutor {
 
         final String vmOptions = config.getProperty(PROP_VM_OPTIONS);
         executor = new DefaultExecutor();
-        final CommandLine cl = new CommandLine(javaExecutable);
+        final CommandLine cl = new CommandLine(jvmFullPath);
         if (vmOptions != null && vmOptions.length() > 0) {
             cl.addArguments(vmOptions);
         }
@@ -183,4 +184,4 @@ public class JarExecutor {
             throw new IllegalStateException(d + " is not a Runnable, cannot destroy process");
         }
     }
-}
\ No newline at end of file
+}



Mime
View raw message