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