public final class JDK extends ToolInstallation implements NodeSpecific<JDK>, EnvironmentSpecific<JDK>
Modifier and Type | Class and Description |
---|---|
static class |
JDK.ConverterImpl |
static class |
JDK.DescriptorImpl |
ToolInstallation.ToolConverter
ExtensionPoint.LegacyInstancesAreScopedToHudson
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_NAME
Name of the “System JDK”, which is just the JDK on Jenkins' $PATH.
|
Constructor and Description |
---|
JDK(String name,
String javaHome) |
JDK(String name,
String home,
List<? extends ToolProperty<?>> properties) |
Modifier and Type | Method and Description |
---|---|
void |
buildEnvVars(EnvVars env)
Sets PATH and JAVA_HOME from this JDK.
|
void |
buildEnvVars(Map<String,String> env)
Deprecated.
as of 1.460. Use
buildEnvVars(EnvVars) |
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
Use
ToolInstallation.getHome() |
static boolean |
isDefaultJDKValid(Node n)
Checks if "java" is in PATH on the given node.
|
static boolean |
isDefaultName(String name) |
all, getHome, getName, getProperties, readResolve, toString, translate, translate, translateFor, writeReplace
getDescriptor
public static final String DEFAULT_NAME
@DataBoundConstructor public JDK(String name, String home, List<? extends ToolProperty<?>> properties)
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean isDefaultName(String name)
@Deprecated public String getJavaHome()
ToolInstallation.getHome()
public File getBinDir()
public boolean getExists()
@Deprecated public void buildEnvVars(Map<String,String> env)
buildEnvVars(EnvVars)
public void buildEnvVars(EnvVars env)
buildEnvVars
in class ToolInstallation
public JDK forNode(Node node, TaskListener log) throws IOException, InterruptedException
NodeSpecific
forNode
in interface NodeSpecific<JDK>
IOException
InterruptedException
public JDK forEnvironment(EnvVars environment)
EnvironmentSpecific
forEnvironment
in interface EnvironmentSpecific<JDK>
public static boolean isDefaultJDKValid(Node n)
If it's not, then the user must specify a configured JDK, so this is often useful for form field validation.
Copyright © 2004–2021. All rights reserved.