Package hudson.model
Class JDK
-
- All Implemented Interfaces:
ExtensionPoint,Describable<ToolInstallation>,EnvironmentSpecific<JDK>,NodeSpecific<JDK>,Serializable
public final class JDK extends ToolInstallation implements NodeSpecific<JDK>, EnvironmentSpecific<JDK>
Information about JDK installation.- Author:
- Kohsuke Kawaguchi
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJDK.ConverterImplstatic classJDK.DescriptorImpl-
Nested classes/interfaces inherited from class hudson.tools.ToolInstallation
ToolInstallation.ToolConverter
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_NAMEName of the “System JDK”, which is just the JDK on Jenkins' $PATH.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidbuildEnvVars(EnvVars env)Sets PATH and JAVA_HOME from this JDK.voidbuildEnvVars(Map<String,String> env)Deprecated.as of 1.460.JDKforEnvironment(EnvVars environment)Returns a specialized copy of T for functioning in the given environment.JDKforNode(Node node, TaskListener log)Returns a specialized copy of T for functioning in the given node.FilegetBinDir()Gets the path to the bin directory.booleangetExists()Returns true if the executable exists.StringgetJavaHome()Deprecated.as of 1.304 UseToolInstallation.getHome()static booleanisDefaultJDKValid(Node n)Checks if "java" is in PATH on the given node.static booleanisDefaultName(String name)-
Methods inherited from class hudson.tools.ToolInstallation
all, getHome, getName, getProperties, readResolve, toString, translate, translate, translateFor, writeReplace
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Field Detail
-
DEFAULT_NAME
public static final String DEFAULT_NAME
Name of the “System JDK”, which is just the JDK on Jenkins' $PATH.- Since:
- 1.577
- See Also:
- Constant Field Values
-
-
Method Detail
-
isDefaultName
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean isDefaultName(String name)
-
getJavaHome
@Deprecated public String getJavaHome()
Deprecated.as of 1.304 UseToolInstallation.getHome()install directory.
-
getBinDir
public File getBinDir()
Gets the path to the bin directory.
-
getExists
public boolean getExists()
Returns true if the executable exists.
-
buildEnvVars
@Deprecated public void buildEnvVars(Map<String,String> env)
Deprecated.as of 1.460. UsebuildEnvVars(EnvVars)
-
buildEnvVars
public void buildEnvVars(EnvVars env)
Sets PATH and JAVA_HOME from this JDK.- Overrides:
buildEnvVarsin classToolInstallation
-
forNode
public JDK forNode(Node node, TaskListener log) throws IOException, InterruptedException
Description copied from interface:NodeSpecificReturns a specialized copy of T for functioning in the given node.- Specified by:
forNodein interfaceNodeSpecific<JDK>- Throws:
IOExceptionInterruptedException
-
forEnvironment
public JDK forEnvironment(EnvVars environment)
Description copied from interface:EnvironmentSpecificReturns a specialized copy of T for functioning in the given environment.- Specified by:
forEnvironmentin interfaceEnvironmentSpecific<JDK>
-
isDefaultJDKValid
public static boolean isDefaultJDKValid(Node n)
Checks if "java" is in PATH on the given node.If it's not, then the user must specify a configured JDK, so this is often useful for form field validation.
-
-