From 7926b4fde36b76848d123186eeea60a075984c44 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Mon, 11 Dec 2006 03:15:28 +0000
Subject: [PATCH] Update the Java Web Start, GUI, and CLI setup modes to write a shell script or batch file that can be used to set JAVA_HOME. Update all of the tools and administrative scripts provided with OpenDS so that they will use this to set JAVA_HOME unless it's already set in the user's environment.
---
opends/resource/bin/_server-script.bat | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/opends/resource/bin/_server-script.bat b/opends/resource/bin/_server-script.bat
index 908963e..7905601 100644
--- a/opends/resource/bin/_server-script.bat
+++ b/opends/resource/bin/_server-script.bat
@@ -47,21 +47,26 @@
:noJavaBin
if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-set JAVA_BIN="%JAVA_HOME%\bin\java.exe"
+set JAVA_BIN=%JAVA_HOME%\bin\java.exe
goto setClassPath
:noJavaHome
+if not exist "%DIR_HOME%\bin\set-java-home.bat" goto noSetJavaHome
+call "%DIR_HOME%\bin\set-java-home.bat"
+set JAVA_BIN=%JAVA_HOME%\bin\java.exe
+goto setClassPath
+
+:noSetJavaHome
echo Error: JAVA_HOME environment variable is not set.
echo Please set it to a valid Java 5 installation.
goto end
-
:setClassPath
FOR %%x in ("%DIR_HOME%\lib\*.jar") DO call "%DIR_HOME%\bin\setcp.bat" %%x
set PATH=%SystemRoot%
-%JAVA_BIN% %JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDS_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" %*
+"%JAVA_BIN%" %JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDS_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" %*
:end
--
Gitblit v1.10.0