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:
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.tools.ToolInstallation
ToolInstallation.ToolConverter
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of the “System JDK”, which is just the JDK on Jenkins' $PATH. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
buildEnvVars
(EnvVars env) Sets PATH and JAVA_HOME from this JDK.void
buildEnvVars
(Map<String, String> env) Deprecated.as of 1.460.forEnvironment
(EnvVars environment) Returns a specialized copy of T for functioning in the given environment.forNode
(Node node, TaskListener log) Returns a specialized copy of T for functioning in the given node.Gets the path to the bin directory.boolean
Returns true if the executable exists.Deprecated.as of 1.304 UseToolInstallation.getHome()
static boolean
Checks if "java" is in PATH on the given node.static boolean
isDefaultName
(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 Details
-
DEFAULT_NAME
Name of the “System JDK”, which is just the JDK on Jenkins' $PATH.- Since:
- 1.577
- See Also:
-
-
Constructor Details
-
JDK
-
JDK
@DataBoundConstructor public JDK(String name, String home, List<? extends ToolProperty<?>> properties)
-
-
Method Details
-
isDefaultName
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean isDefaultName(String name) -
getJavaHome
Deprecated.as of 1.304 UseToolInstallation.getHome()
install directory. -
getBinDir
Gets the path to the bin directory. -
getExists
public boolean getExists()Returns true if the executable exists. -
buildEnvVars
Deprecated.as of 1.460. UsebuildEnvVars(EnvVars)
-
buildEnvVars
Sets PATH and JAVA_HOME from this JDK.- Overrides:
buildEnvVars
in classToolInstallation
-
forNode
Description copied from interface:NodeSpecific
Returns a specialized copy of T for functioning in the given node.- Specified by:
forNode
in interfaceNodeSpecific<JDK>
- Throws:
IOException
InterruptedException
-
forEnvironment
Description copied from interface:EnvironmentSpecific
Returns a specialized copy of T for functioning in the given environment.- Specified by:
forEnvironment
in interfaceEnvironmentSpecific<JDK>
-
isDefaultJDKValid
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.
-