From 5c961270fe3401ebb151b857e9e6bb3443aa0ffc Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 25 Apr 2007 17:13:06 +0000
Subject: [PATCH] Fix for issue 1273 (exception if JAVA_HOME undefined in scripts).

---
 opends/resource/setup.bat |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/opends/resource/setup.bat b/opends/resource/setup.bat
index e049d94..705b208 100644
--- a/opends/resource/setup.bat
+++ b/opends/resource/setup.bat
@@ -48,15 +48,23 @@
 
 :noSetJavaHome
 echo Error: JAVA_HOME environment variable is not set.
-echo        Please set it to a valid Java 5 installation.
+echo        Please set it to a valid Java 5 (or later) installation.
 goto end
 
+:noValidJavaHome
+echo ERROR:  The detected Java version could not be used.  Please set 
+echo         JAVA_HOME to to a valid Java 5 (or later) installation.
+goto end
 
 :setClassPath
 FOR %%x in ("%DIR_HOME%\lib\*.jar") DO call "%DIR_HOME%\bat\setcp.bat" %%x
 
 set PATH=%SystemRoot%
 
+rem Test that the provided JDK is 1.5 compatible.
+"%JAVA_BIN%" org.opends.server.tools.InstallDS -t > NUL 2>&1
+if not %errorlevel% == 0 goto noValidJavaHome
+
 if "%*" == "" goto callLaunch
 goto callJava
 

--
Gitblit v1.10.0