hudson.model
Class JDK

java.lang.Object
  extended by hudson.model.AbstractDescribableImpl<ToolInstallation>
      extended by hudson.tools.ToolInstallation
          extended by 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:
Serialized Form

Nested Class Summary
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
 
Constructor Summary
JDK(String name, String javaHome)
           
JDK(String name, String home, List<? extends ToolProperty<?>> properties)
           
 
Method Summary
 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.
 
Methods inherited from class hudson.tools.ToolInstallation
all, getHome, getName, getProperties, readResolve, translate, translate, translateFor
 
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDK

public JDK(String name,
           String javaHome)

JDK

@DataBoundConstructor
public JDK(String name,
                                String home,
                                List<? extends ToolProperty<?>> properties)
Method Detail

getJavaHome

public String getJavaHome()
Deprecated. as of 1.304 Use ToolInstallation.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

public void buildEnvVars(Map<String,String> env)
Deprecated. as of 1.460. Use buildEnvVars(EnvVars)


buildEnvVars

public void buildEnvVars(EnvVars env)
Sets PATH and JAVA_HOME from this JDK.

Overrides:
buildEnvVars in class ToolInstallation

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 interface NodeSpecific<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 interface EnvironmentSpecific<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.



Copyright © 2004-2013. All Rights Reserved.