Class Jdk
- java.lang.Object
-
- com.atlassian.bamboo.configuration.Jdk
-
public class Jdk extends Object
This class is a POJO holding the information about a system JDK.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CAPABILITY_JDK_PREFIX
static String
CAPABILITY_JDK_TYPE
static String
CAPABILITY_TYPE_NAME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NotNull Jdk
discoverDefaultJdk()
For some reason, the system's JAVA_HOME is sometimes the Jdk's Jre directory.String
getHomeDirectory()
String
getLabel()
boolean
isAJdk()
Does the given homeDirectory reference a JDK home?boolean
isValid()
Does this object reference a valid JDK?String
toString()
-
-
-
Field Detail
-
CAPABILITY_JDK_TYPE
public static final String CAPABILITY_JDK_TYPE
- See Also:
- Constant Field Values
-
CAPABILITY_TYPE_NAME
public static final String CAPABILITY_TYPE_NAME
- See Also:
- Constant Field Values
-
CAPABILITY_JDK_PREFIX
public static final String CAPABILITY_JDK_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
isValid
public boolean isValid()
Does this object reference a valid JDK?- Returns:
- Does the homeDirectory contain bin/java and lib/tools.jar?
-
isAJdk
public boolean isAJdk()
Does the given homeDirectory reference a JDK home?- Returns:
- true iff it contains a lib/tools.jar
-
discoverDefaultJdk
@NotNull public static @NotNull Jdk discoverDefaultJdk()
For some reason, the system's JAVA_HOME is sometimes the Jdk's Jre directory.If that's the case, we return the parent dir.
- Returns:
- The default system JDK
-
getLabel
public String getLabel()
-
getHomeDirectory
public String getHomeDirectory()
-
-