2976N/Arem The contents of this file are subject to the terms of the
2976N/Arem Common Development and Distribution License, Version 1.0 only
2976N/Arem (the "License"). You may not use this file except in compliance
2976N/Arem You can obtain a copy of the license at
2976N/Arem See the License for the specific language governing permissions
2976N/Arem and limitations under the License.
2976N/Arem When distributing Covered Code, include this CDDL HEADER in each
2976N/Arem file and include the License file at
2976N/Arem add the following below this CDDL HEADER, with the fields enclosed
2976N/Arem by brackets "[]" replaced with your own identifying information:
2976N/Arem Portions Copyright [yyyy] [name of copyright owner]
5022N/Arem Copyright 2008-2010 Sun Microsystems, Inc.
2976N/Aset SET_JAVA_HOME_AND_ARGS_DONE=false
2976N/Aset SET_ENVIRONMENT_VARS_DONE=false
2976N/Aset SET_CLASSPATH_DONE=false
3824N/Aif "%INSTALL_ROOT%" == "" goto setInstanceRoot
2976N/Aif "%SCRIPT_UTIL_CMD%" == "set-full-environment-and-test-java" goto setFullEnvironmentAndTestJava
2976N/Aif "%SCRIPT_UTIL_CMD%" == "set-full-environment" goto setFullEnvironment
2976N/Aif "%SCRIPT_UTIL_CMD%" == "set-java-home-and-args" goto setJavaHomeAndArgs
2976N/Aif "%SCRIPT_UTIL_CMD%" == "set_environment_vars" goto setEnvironmentVars
2976N/Aif "%SCRIPT_UTIL_CMD%" == "test-java" goto testJava
2976N/Aif "%SCRIPT_UTIL_CMD%" == "set-classpath" goto setClassPath
2976N/Afor %%i in (%~sf0) do set DIR_HOME=%%~dPsi..
4495N/Aif "%SET_CLASSPATH_DONE%" == "true" goto prepareCheck
3824N/AFOR %%x in ("%INSTALL_ROOT%\lib\*.jar") DO call "%INSTALL_ROOT%\lib\
setcp.bat" %%x
3824N/Aif "%INSTALL_ROOT%" == "%INSTANCE_ROOT%"goto setClassPathDone
3824N/AFOR %%x in ("%INSTANCE_ROOT%\lib\*.jar") DO call "%INSTANCE_ROOT%\lib\
setcp.bat" %%x
4287N/AFOR %%x in ("%INSTALL_ROOT%\resources\*.jar") DO call "%INSTALL_ROOT%\lib\
setcp.bat" %%x
3824N/Aset CLASSPATH=%INSTANCE_ROOT%\classes;%CLASSPATH%
2976N/Aif "%SET_JAVA_HOME_AND_ARGS_DONE%" == "false" goto setJavaHomeAndArgs
2976N/Aif "%SET_CLASSPATH_DONE%" == "false" goto setClassPath
2976N/Aif "%SET_ENVIRONMENT_VARS_DONE%" == "false" goto setEnvironmentVars
2976N/A:setFullEnvironmentAndTestJava
2976N/Aif "%SET_JAVA_HOME_AND_ARGS_DONE%" == "false" goto setJavaHomeAndArgs
2976N/Aif "%SET_CLASSPATH_DONE%" == "false" goto setClassPath
2976N/Aif "%SET_ENVIRONMENT_VARS_DONE%" == "false" goto setEnvironmentVars
4495N/Aif "%SET_JAVA_HOME_AND_ARGS_DONE%" == "true" goto prepareCheck
5022N/Aif "%OPENDS_JAVA_BIN%" == "" goto checkEnvJavaHome
2976N/Aset SET_JAVA_HOME_AND_ARGS_DONE=true
2976N/Aif "%OPENDS_JAVA_BIN%" == "" goto checkOpenDSJavaHome
2976N/Aif not exist "%OPENDS_JAVA_BIN%" goto checkOpenDSJavaHome
4915N/Aif "%OPENDS_JAVA_HOME%" == "" goto checkJavaPath
4915N/Aif not %errorlevel% == 0 goto checkJavaBin
2976N/Aif "%JAVA_BIN%" == "" goto checkJavaHome
2976N/Aif not exist "%JAVA_BIN%" goto checkJavaHome
2976N/Aset OPENDS_JAVA_BIN=%JAVA_BIN%
4915N/Aif "%JAVA_HOME%" == "" goto noJavaFound
4261N/Aecho ERROR: Could not find a valid Java binary to be used.
5224N/Aecho You must specify the path to a valid Java 6.0 update 10 or higher version.
2976N/Aecho The procedure to follow is:
2976N/Aecho 2. Set the environment variable OPENDS_JAVA_HOME to the root of a valid
4261N/Aecho If you want to have specific Java settings for each command line you must
2976N/Aecho follow the steps 3 and 4.
4261N/Aecho 3. Edit the properties file specifying the Java binary and the Java arguments
4261N/Aecho for each command line. The Java properties file is located in:
4495N/Aif %SET_ENVIRONMENT_VARS_DONE% == "true" goto prepareCheck
3007N/Aset PATH=%SystemRoot%;%PATH%
2976N/Aset SET_ENVIRONMENT_VARS_DONE=true
3449N/Aset RESULT_CODE=%errorlevel%
3449N/Aif %RESULT_CODE% == 13 goto notSupportedJavaHome
3449N/Aif not %RESULT_CODE% == 0 goto noValidJavaHome
2976N/Aif NOT "%OPENDS_JAVA_ARGS%" == "" goto noValidHomeWithArgs
2976N/Aecho ERROR: The detected Java version could not be used. The detected
5224N/Aecho You must specify the path to a valid Java 6.0 update 10 or higher version.
2976N/Aecho The procedure to follow is:
2976N/Aecho 2. Set the environment variable OPENDS_JAVA_HOME to the root of a valid
4261N/Aecho If you want to have specific Java settings for each command line you must
2976N/Aecho follow the steps 3 and 4.
4261N/Aecho 3. Edit the properties file specifying the Java binary and the Java arguments
4261N/Aecho for each command line. The Java properties file is located in:
5218N/Arem We get here when the java version is 6 (or up) but not supported. We run
3449N/Arem InstallDS again to see a localized message.
4261N/Aecho ERROR: The detected Java version could not be used with the set of Java
2976N/Aecho arguments %OPENDS_JAVA_ARGS%.
4261N/Aecho The detected Java binary is:
5224N/Aecho You must specify the path to a valid Java 6.0 update 10 or higher version.
2976N/Aecho The procedure to follow is:
2976N/Aecho 2. Set the environment variable OPENDS_JAVA_HOME to the root of a valid
4261N/Aecho If you want to have specific Java settings for each command line you must
2976N/Aecho follow the steps 3 and 4.
4261N/Aecho 3. Edit the properties file specifying the Java binary and the Java arguments
4261N/Aecho for each command line. The Java properties file is located in:
4495N/Aif [%1] == [--help] goto end
4495N/Aif [%1] == [--version] goto end
4495N/Aif [%1] == [--fullversion] goto end
4495N/Arem Perform check unless it is specified not to do it
4495N/Aif "%NO_CHECK%" == "" set NO_CHECK=false
4495N/Aif "%NO_CHECK%" == "true" goto end
4495N/Aif "%CHECK_VERSION%" == "true" set OPT_CHECK_VERSION=--checkVersion
4495N/Aset RESULT_CODE=%errorlevel%
4495N/Aif "%RESULT_CODE%" == "0" goto end