Package hudson.model
Class JDK
java.lang.Object
hudson.tools.ToolInstallation
hudson.model.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 ClassesNested classes/interfaces inherited from class hudson.tools.ToolInstallation
ToolInstallation.ToolConverterNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the “System JDK”, which is just the JDK on Jenkins' $PATH. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildEnvVars(EnvVars env) Sets PATH and JAVA_HOME from this JDK.voidbuildEnvVars(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.booleanReturns true if the executable exists.Deprecated.as of 1.304 UseToolInstallation.getHome()static booleanChecks 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, writeReplaceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface hudson.model.Describable
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:
buildEnvVarsin classToolInstallation
-
forNode
Description copied from interface:NodeSpecificReturns a specialized copy of T for functioning in the given node.- Specified by:
forNodein interfaceNodeSpecific<JDK>- Throws:
IOExceptionInterruptedException
-
forEnvironment
Description copied from interface:EnvironmentSpecificReturns a specialized copy of T for functioning in the given environment.- Specified by:
forEnvironmentin 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.
-