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