com.izforge.izpack.panels.jdkpath
Class JDKPathPanelHelper

java.lang.Object
  extended by com.izforge.izpack.panels.jdkpath.JDKPathPanelHelper

public class JDKPathPanelHelper
extends Object


Field Summary
static String JDK_PATH
           
static String JDK_ROOT_KEY
           
static String JDK_VALUE_NAME
           
static String JDK_VAR_NAME
           
static String OSX_JDK_HOME
           
static String[] testFiles
           
 
Constructor Summary
JDKPathPanelHelper()
           
 
Method Summary
static String extractJavaVersion(String javaVersion)
          Given a 'dirty' string representing the javaVersion.
static String getCurrentJavaVersion(String path, Platform platform)
          Run the java binary from the JAVA_HOME directory specified from the user.
static String getDefaultJavaPath(InstallData installData, RegistryDefaultHandler handler)
          Obtain the default java path
static String getJavaHomeFromRegistry(RegistryDefaultHandler handler)
          Returns the path to the needed JDK if found in the registry.
static void initialize(InstallData installData)
          MUST always be called in constructor of JDKPathConsolePanel and JDKPathPanel
static boolean skipPanel(InstallData installData, String path)
          Check if JDK panel should be skipped.
static String validate(String javaHome, String javaVersion, Messages messages)
          Central validation of java path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

testFiles

public static final String[] testFiles

JDK_VALUE_NAME

public static final String JDK_VALUE_NAME
See Also:
Constant Field Values

JDK_ROOT_KEY

public static final String JDK_ROOT_KEY
See Also:
Constant Field Values

OSX_JDK_HOME

public static final String OSX_JDK_HOME
See Also:
Constant Field Values

JDK_PATH

public static final String JDK_PATH
See Also:
Constant Field Values

JDK_VAR_NAME

public static final String JDK_VAR_NAME
See Also:
Constant Field Values
Constructor Detail

JDKPathPanelHelper

public JDKPathPanelHelper()
Method Detail

initialize

public static void initialize(InstallData installData)
MUST always be called in constructor of JDKPathConsolePanel and JDKPathPanel

Parameters:
installData -

getDefaultJavaPath

public static String getDefaultJavaPath(InstallData installData,
                                        RegistryDefaultHandler handler)
Obtain the default java path

Parameters:
installData -
handler -
Returns:

getJavaHomeFromRegistry

public static String getJavaHomeFromRegistry(RegistryDefaultHandler handler)
Returns the path to the needed JDK if found in the registry. If there are more than one JDKs registered, that one with the highest allowed version will be returned. Works only on windows. On Unix an empty string returns.

Returns:
the path to the needed JDK if found in the windows registry

getCurrentJavaVersion

public static String getCurrentJavaVersion(String path,
                                           Platform platform)
Run the java binary from the JAVA_HOME directory specified from the user. We do this to figure out what version of java the user has specified

Parameters:
path - JAVA_HOME
platform - specifies which platform user is running installation on
Returns:
string representation of the java version

extractJavaVersion

public static String extractJavaVersion(String javaVersion)
Given a 'dirty' string representing the javaVersion. Extract the actual java version and strip away any extra information.

Parameters:
javaVersion -
Returns:

validate

public static String validate(String javaHome,
                              String javaVersion,
                              Messages messages)
Central validation of java path. Also gives allowance to central strings.

Parameters:
javaHome - JAVA_HOME path to test
javaVersion - the java version being queried
messages - available messages
Returns:
error message if validation failed, otherwise an empty string

skipPanel

public static boolean skipPanel(InstallData installData,
                                String path)
Check if JDK panel should be skipped. Return true if panel should be skipped otherwise false.

Parameters:
installData -
path -
Returns:


Copyright © 2018. All rights reserved.