_script-util.sh revision 5636
2976N/A# The contents of this file are subject to the terms of the 2976N/A# Common Development and Distribution License, Version 1.0 only 2976N/A# (the "License"). You may not use this file except in compliance 2976N/A# You can obtain a copy of the license at 2976N/A# See the License for the specific language governing permissions 2976N/A# and limitations under the License. 2976N/A# When distributing Covered Code, include this CDDL HEADER in each 2976N/A# file and include the License file at 2976N/A# add the following below this CDDL HEADER, with the fields enclosed 2976N/A# by brackets "[]" replaced with your own identifying information: 2976N/A# Portions Copyright [yyyy] [name of copyright owner] 5022N/A# Copyright 2008-2010 Sun Microsystems, Inc. 5306N/A# Portions Copyright 2010-2011 ForgeRock AS 5636N/A echo "Please set OPENDJ_JAVA_HOME to the root of a Java 6 update 10 (or higher) installation" 4915N/A echo "specify the Java version to be used" 4915N/A# function that tests the JAVA_HOME env variable. 5636N/A if test -f "${OPENDJ_JAVA_BIN}" 4915N/A# function that tests the JAVA_BIN env variable. 5636N/A if test -f "${OPENDJ_JAVA_BIN}" 4915N/A# function that tests the java executable in the PATH env variable. 5636N/A if test -f "${OPENDJ_JAVA_BIN}" 5636N/A# function that tests legacy OPENDS_JAVA_HOME env variable. 4915N/A if test -z "${OPENDS_JAVA_HOME}" 5636N/A if test -f "${OPENDJ_JAVA_BIN}" 5636N/A# function that tests the OPENDJ_JAVA_HOME env variable. 5636N/A if test -z "${OPENDJ_JAVA_HOME}" 5636N/A if test -f "${OPENDJ_JAVA_BIN}" 5636N/A# function that tests the OPENDJ_JAVA_BIN env variable. 5636N/A if test -z "${OPENDJ_JAVA_BIN}" 5636N/A # Check for legacy OPENDS_JAVA_BIN 5636N/A if test -z "${OPENDS_JAVA_BIN}" 5636N/A if test -f "${OPENDS_JAVA_BIN}" 5636N/A if test -f "${OPENDJ_JAVA_BIN}" 2976N/A# function that sets the java home 5636N/A# Function that sets OPENDJ_JAVA_ARGS if not yet set but OPENDS_JAVA_ARGS is. 5636N/A if test -z "${OPENDJ_JAVA_ARGS}" 5636N/A if test -n "${OPENDS_JAVA_ARGS}" 4243N/A# Determine whether the detected Java environment is acceptable for use. 5636N/A if test -z "${OPENDJ_JAVA_ARGS}" 5218N/A # This is a particular error code that means that the Java version is 6 3449N/A # but not supported. Let InstallDS to display the localized error message 2976N/A echo "ERROR: The detected Java version could not be used. The detected" 5224N/A echo "You must specify the path to a valid Java 6.0 update 10 or higher version." 2976N/A echo "The procedure to follow is:" 5636N/A echo "2. Set the environment variable OPENDJ_JAVA_HOME to the root of a valid " 5218N/A echo "Java 6.0 installation." 4261N/A echo "If you want to have specific Java settings for each command line you must" 2976N/A echo "follow the steps 3 and 4." 4261N/A echo "3. Edit the properties file specifying the Java binary and the Java arguments" 4261N/A echo "for each command line. The Java properties file is located in:" 5218N/A # This is a particular error code that means that the Java version is 6 3449N/A # but not supported. Let InstallDS to display the localized error message 4261N/A echo "ERROR: The detected Java version could not be used with the set of Java" 5636N/A echo "arguments ${OPENDJ_JAVA_ARGS}." 4261N/A echo "The detected Java binary is:" 5224N/A echo "You must specify the path to a valid Java 6.0 update 10 or higher version." 2976N/A echo "The procedure to follow is:" 5636N/A echo "2. Set the environment variable OPENDJ_JAVA_HOME to the root of a valid " 5218N/A echo "Java 6.0 installation." 4261N/A echo "If you want to have specific Java settings for each command line you must" 2976N/A echo "follow the steps 3 and 4." 4261N/A echo "3. Edit the properties file specifying the Java binary and the Java arguments" 4261N/A echo "for each command line. The Java properties file is located in:" 2976N/A# Explicitly set the PATH, LD_LIBRARY_PATH, LD_PRELOAD, and other important 2976N/A# system environment variables for security and compatibility reasons. 2976N/A# Configure the appropriate CLASSPATH. 4392N/A if [ "${INSTALL_ROOT}" != "${INSTANCE_ROOT}" ] 3824N/Aif test "${INSTALL_ROOT}" =
"" 2976N/A # Capture the current working directory so that we can change to it later. 2976N/A # Then capture the location of this script and the Directory Server instance 2976N/A # root so that we can use them to create appropriate paths. 3860N/Aif test "${INSTANCE_ROOT}" =
"" 4883N/A if [ -f
"${INSTALL_ROOT}/configure" ]
3860N/A if [
"${SCRIPT_NAME}" =
"configure" ]
4103N/A echo "${INSTALL_ROOT}/configure has already been run. Exiting." 3860N/A if [
"${SCRIPT_NAME}" !=
"configure" ]
3885N/A echo "No instance found. Run ${INSTALL_ROOT}/configure to create it." 3860N/A if [ -d
"${INSTANCE_ROOT}" ]
2976N/Aif test "${SCRIPT_UTIL_CMD}" =
"set-full-environment-and-test-java" 2976N/Aelif test "${SCRIPT_UTIL_CMD}" =
"set-full-environment" 4883N/A elif test "${SCRIPT_UTIL_CMD}" =
"set-java-home-and-args" 2976N/Aelif test "${SCRIPT_UTIL_CMD}" =
"set-environment-vars" 2976N/Aelif test "${SCRIPT_UTIL_CMD}" =
"set-classpath" 2976N/Aelif test "${SCRIPT_UTIL_CMD}" =
"test-java" 4103N/Aif [
"${SCRIPT_NAME}" !=
"configure" ] && [
"${SCRIPT_NAME}" !=
"unconfigure" ]
3885N/A # Perform check unless it is specified not to do it 3885N/A # No check for --version or --help option 3860N/A if [
"${CHECK_VERSION}" =
"yes" ]
3860N/A # Launch the CheckInstance process.