Class JavaRunnerUtil
- java.lang.Object
-
- jetbrains.buildServer.agent.runner.JavaRunnerUtil
-
public class JavaRunnerUtil extends Object
- Author:
- Sergey.Anchipolevsky Date: 18.04.2007
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,String>
composeSystemProperties(AgentRunningBuild build, BuildRunnerContext runnerContext)
Returns "default" set of system properties for the java process being launchedstatic List<String>
extractJvmArgs(String userDefinedArgs)
static List<String>
extractJvmArgs(Map<String,String> runParameters)
static String
findJavaExecutable(String explicitlyDefinedJavaHome, Map<String,String> propsAndVars, String baseDir)
Finds Java executable (java.exe) using the specified parameters: - explicitly defined path - map of properties and environment variables (with corresponding prefixes) If found path is relative, it will be resolved against base dir.static File
findJavaExecutablePath(String explicitlyDefinedJavaHome, Map<String,String> propsAndVars, String baseDir)
Finds Java executable (java.exe) using the specified parameters: - explicitly defined path - map of properties and environment variables (with corresponding prefixes) If found path is relative, it will be resolved against base dir.static String
findJavaHome(String explicitlyDefinedJavaHome, Map<String,String> propsAndVars, String baseDir)
Finds Java home - path to a directory where Java is installed.static List<String>
makeParamListFromProps(Map<String,String> allProps)
-
-
-
Method Detail
-
makeParamListFromProps
public static List<String> makeParamListFromProps(Map<String,String> allProps)
-
composeSystemProperties
@NotNull public static Map<String,String> composeSystemProperties(@NotNull AgentRunningBuild build, @NotNull BuildRunnerContext runnerContext)
Returns "default" set of system properties for the java process being launched- Parameters:
build
- agent running buildrunnerContext
- runner context- Returns:
- Map with the properties
-
findJavaExecutable
@Nullable public static String findJavaExecutable(@Nullable String explicitlyDefinedJavaHome, @NotNull Map<String,String> propsAndVars, @Nullable String baseDir)
Finds Java executable (java.exe) using the specified parameters: - explicitly defined path - map of properties and environment variables (with corresponding prefixes) If found path is relative, it will be resolved against base dir.- Parameters:
explicitlyDefinedJavaHome
- explicitly defined pathpropsAndVars
- map of properties and environment variables (with corresponding prefixes)baseDir
- base directory to be used for relative path- Returns:
- path to existing java executable or null
-
findJavaExecutablePath
@Nullable public static File findJavaExecutablePath(@Nullable String explicitlyDefinedJavaHome, @NotNull Map<String,String> propsAndVars, @Nullable String baseDir)
Finds Java executable (java.exe) using the specified parameters: - explicitly defined path - map of properties and environment variables (with corresponding prefixes) If found path is relative, it will be resolved against base dir. No file existence checks are performed. Path will end with 'java.exe' in windows and with 'java' on all other OSes.- Parameters:
explicitlyDefinedJavaHome
- explicitly defined pathpropsAndVars
- map of properties and environment variables (with corresponding prefixes)baseDir
- base directory to be used for relative path- Returns:
- found and possible resolved absolute path to java executable, null is returned is no candidate paths are found at all
-
findJavaHome
@Nullable public static String findJavaHome(@Nullable String explicitlyDefinedJavaHome, @NotNull Map<String,String> propsAndVars, @Nullable String baseDir)
Finds Java home - path to a directory where Java is installed.- Parameters:
explicitlyDefinedJavaHome
- explicitly defined pathpropsAndVars
- map of properties and environment variables (with corresponding prefixes)baseDir
- base directory to be used for relative path- Returns:
- Java home - path to a directory where Java is installed
-
extractJvmArgs
@NotNull public static List<String> extractJvmArgs(@NotNull Map<String,String> runParameters)
-
-