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 class
JDK.ConverterImpl
static class
JDK.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 String
DEFAULT_NAME
Name 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 void
buildEnvVars(EnvVars env)
Sets PATH and JAVA_HOME from this JDK.void
buildEnvVars(Map<String,String> env)
Deprecated.as of 1.460.JDK
forEnvironment(EnvVars environment)
Returns a specialized copy of T for functioning in the given environment.JDK
forNode(Node node, TaskListener log)
Returns a specialized copy of T for functioning in the given node.File
getBinDir()
Gets the path to the bin directory.boolean
getExists()
Returns true if the executable exists.String
getJavaHome()
Deprecated.as of 1.304 UseToolInstallation.getHome()
static boolean
isDefaultJDKValid(Node n)
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 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:
buildEnvVars
in classToolInstallation
-
forNode
public JDK forNode(Node node, TaskListener log) throws IOException, InterruptedException
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
public JDK forEnvironment(EnvVars environment)
Description copied from interface:EnvironmentSpecific
Returns a specialized copy of T for functioning in the given environment.- Specified by:
forEnvironment
in 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.
-
-