KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > common > commands > JavaHelper


1 package org.objectweb.celtix.common.commands;
2
3 import java.io.File JavaDoc;
4
5 public final class JavaHelper {
6
7     private JavaHelper() {
8         //complete
9
}
10
11     /** Get the command to launch a JVM. Find the java command
12      * relative to the java.home property rather than what is on the
13      * path. It is possible that the java version being used it not
14      * on the path
15      *
16      */

17     public static String JavaDoc getJavaCommand() {
18         String JavaDoc javaHome = System.getProperty("java.home");
19         if (null != javaHome) {
20             return javaHome + File.separator + "bin"
21                 + File.separator + "java" + ForkedCommand.EXE_SUFFIX;
22         } else {
23             return "java" + ForkedCommand.EXE_SUFFIX;
24         }
25     }
26 }
27
Popular Tags