db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fuzzylo...@apache.org
Subject svn commit: r394769 - in /db/derby/code/trunk/frameworks: NetworkServer/bin/ embedded/bin/
Date Mon, 17 Apr 2006 20:28:30 GMT
Author: fuzzylogic
Date: Mon Apr 17 13:28:26 2006
New Revision: 394769

URL: http://svn.apache.org/viewcvs?rev=394769&view=rev
Log:
DERBY-1082: Fix quoting of JAVA_HOME in scripts. Make use of JAVA_HOME
consistent across scripts.

Modified:
    db/derby/code/trunk/frameworks/NetworkServer/bin/NetworkServerControl.bat
    db/derby/code/trunk/frameworks/NetworkServer/bin/NetworkServerControl.ksh
    db/derby/code/trunk/frameworks/NetworkServer/bin/dblook.bat
    db/derby/code/trunk/frameworks/NetworkServer/bin/dblook.ksh
    db/derby/code/trunk/frameworks/NetworkServer/bin/ij.bat
    db/derby/code/trunk/frameworks/NetworkServer/bin/ij.ksh
    db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkClientCP.bat
    db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkClientCP.ksh
    db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkServerCP.bat
    db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkServerCP.ksh
    db/derby/code/trunk/frameworks/NetworkServer/bin/startNetworkServer.bat
    db/derby/code/trunk/frameworks/NetworkServer/bin/startNetworkServer.ksh
    db/derby/code/trunk/frameworks/NetworkServer/bin/stopNetworkServer.bat
    db/derby/code/trunk/frameworks/NetworkServer/bin/stopNetworkServer.ksh
    db/derby/code/trunk/frameworks/NetworkServer/bin/sysinfo.bat
    db/derby/code/trunk/frameworks/NetworkServer/bin/sysinfo.ksh
    db/derby/code/trunk/frameworks/embedded/bin/dblook.bat
    db/derby/code/trunk/frameworks/embedded/bin/dblook.ksh
    db/derby/code/trunk/frameworks/embedded/bin/ij.bat
    db/derby/code/trunk/frameworks/embedded/bin/ij.ksh
    db/derby/code/trunk/frameworks/embedded/bin/setEmbeddedCP.bat
    db/derby/code/trunk/frameworks/embedded/bin/setEmbeddedCP.ksh
    db/derby/code/trunk/frameworks/embedded/bin/sysinfo.bat
    db/derby/code/trunk/frameworks/embedded/bin/sysinfo.ksh

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/NetworkServerControl.bat
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/NetworkServerControl.bat?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/NetworkServerControl.bat (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/NetworkServerControl.bat Mon Apr 17 13:28:26
2006
@@ -11,19 +11,37 @@
 @REM -- 
 @REM -- This file for use on Windows systems
 @REM ---------------------------------------------------------
-
+@echo off
 rem set DERBY_INSTALL=
- 
-@if !"%CLASSPATH%"==! call "%DERBY_INSTALL%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
-@if "%CLASSPATH%" == "" call "%DERBY_INSTALL%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
+
+@if "%DERBY_HOME%"=="" set DERBY_HOME=%DERBY_INSTALL%
+@if "%DERBY_HOME%"=="" goto noderbyhome
+
+@if "%JAVA_HOME%"=="" goto nojavahome
+@if not exist "%JAVA_HOME%\bin\java.exe" goto nojavahome
+
+@if !"%CLASSPATH%"==! call "%DERBY_HOME%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
+@if "%CLASSPATH%" == "" call "%DERBY_HOME%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
 
 @REM ---------------------------------------------------------
 @REM -- start Derby as a Network server
 @REM ---------------------------------------------------------
-java org.apache.derby.drda.NetworkServerControl %*
+"%JAVA_HOME%\bin\java" org.apache.derby.drda.NetworkServerControl %*
+@goto end
 
 @REM ---------------------------------------------------------
 @REM -- To use a different JVM with a different syntax, simply edit
 @REM -- this file
 @REM ---------------------------------------------------------
 
+:nojavahome
+echo JAVA_HOME not set or could not find java executable in JAVA_HOME.
+echo Please set JAVA_HOME to the location of a valid Java installation.
+goto end
+
+:noderbyhome
+echo DERBY_HOME or DERBY_INSTALL not set. Set one of these variables
+echo to the location of your Derby installation.
+goto end
+
+:end
\ No newline at end of file

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/NetworkServerControl.ksh
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/NetworkServerControl.ksh?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/NetworkServerControl.ksh (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/NetworkServerControl.ksh Mon Apr 17 13:28:26
2006
@@ -13,15 +13,34 @@
 
 # DERBY_INSTALL=
 
+DERBY_HOME=${DERBY_HOME:-$DERBY_INSTALL}
+
+[ -z "$DERBY_HOME" ] && {
+  echo "\$DERBY_HOME or \$DERBY_INSTALL not set. Please set one of these variables"
+  echo "to the location of your Derby installation."
+  exit 1
+}
+
+[ -z "$JAVA_HOME" ] && {
+  [ -x /usr/java/bin/java ] && {
+    JAVA_HOME=/usr/java
+  }
+  [ -z "$JAVA_HOME" ] && {
+    echo "JAVA_HOME not set. Please set JAVA_HOME to the location of your Java"
+    echo "installation."
+    exit 1
+  }
+} 
+
 [ -z "$CLASSPATH" ] && {
-  . "$DERBY_INSTALL"/frameworks/NetworkServer/bin/setNetworkServerCP.ksh
+  . "$DERBY_HOME"/frameworks/NetworkServer/bin/setNetworkServerCP.ksh
 }
 
 # ---------------------------------------------------------
 # -- start Derby Network Server
 # ---------------------------------------------------------
 
-java org.apache.derby.drda.NetworkServerControl $*
+"$JAVA_HOME/bin/java" org.apache.derby.drda.NetworkServerControl $*
 
 
 # ---------------------------------------------------------

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/dblook.bat
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/dblook.bat?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/dblook.bat (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/dblook.bat Mon Apr 17 13:28:26 2006
@@ -10,19 +10,37 @@
 @REM --
 @REM -- This file for use on Windows systems
 @REM ---------------------------------------------------------
-
+@echo off
 rem set DERBY_INSTALL=
- 
-@if !"%CLASSPATH%"==! call "%DERBY_INSTALL%"/frameworks/NetworkServer/bin/setNetworkClientCP.bat
-@if "%CLASSPATH%" == "" call "%DERBY_INSTALL%"/frameworks/NetworkServer/bin/setNetworkClientCP.bat
+
+@if "%DERBY_HOME%"=="" set DERBY_HOME=%DERBY_INSTALL%
+@if "%DERBY_HOME%"=="" goto noderbyhome
+
+@if "%JAVA_HOME%"=="" goto nojavahome
+@if not exist "%JAVA_HOME%\bin\java.exe" goto nojavahome
+
+if !"%CLASSPATH%"==! call "%DERBY_HOME%"/frameworks/NetworkServer/bin/setNetworkClientCP.bat
+if "%CLASSPATH%" == "" call "%DERBY_HOME%"/frameworks/NetworkServer/bin/setNetworkClientCP.bat
 
 @REM ---------------------------------------------------------
 @REM -- start dblook
 @REM ---------------------------------------------------------
-java org.apache.derby.tools.dblook %*
+"%JAVA_HOME%\bin\java" org.apache.derby.tools.dblook %*
+@GOTO end
 
 @REM ---------------------------------------------------------
 @REM -- To use a different JVM with a different syntax, simply edit
 @REM -- this file
 @REM ---------------------------------------------------------
 
+:nojavahome
+echo JAVA_HOME not set or could not find java executable in JAVA_HOME.
+echo Please set JAVA_HOME to the location of a valid Java installation.
+goto end
+
+:noderbyhome
+echo DERBY_HOME or DERBY_INSTALL not set. Set one of these variables
+echo to the location of your Derby installation.
+goto end
+
+:end
\ No newline at end of file

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/dblook.ksh
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/dblook.ksh?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/dblook.ksh (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/dblook.ksh Mon Apr 17 13:28:26 2006
@@ -13,14 +13,33 @@
 
 # DERBY_INSTALL=
 
+DERBY_HOME=${DERBY_HOME:-$DERBY_INSTALL}
+
+[ -z "$DERBY_HOME" ] && {
+  echo "\$DERBY_HOME or \$DERBY_INSTALL not set. Please set one of these variables"
+  echo "to the location of your Derby installation."
+  exit 1
+}
+
+[ -z "$JAVA_HOME" ] && {
+  [ -x /usr/java/bin/java ] && {
+    JAVA_HOME=/usr/java
+  }
+  [ -z "$JAVA_HOME" ] && {
+    echo "JAVA_HOME not set. Please set JAVA_HOME to the location of your Java"
+    echo "installation."
+    exit 1
+  }
+} 
+
 [ -z "$CLASSPATH" ] && {
-  . "$DERBY_INSTALL"/frameworks/NetworkServer/bin/setNetworkClientCP.ksh
+  . "$DERBY_HOME"/frameworks/NetworkServer/bin/setNetworkClientCP.ksh
 }
 
 # ---------------------------------------------------------
 # -- start dblook
 # ---------------------------------------------------------
-java org.apache.derby.tools.dblook $@
+"$JAVA_HOME/bin/java" org.apache.derby.tools.dblook $@
 
 # ---------------------------------------------------------
 # -- To use a different JVM with a different syntax, simply edit

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/ij.bat
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/ij.bat?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/ij.bat (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/ij.bat Mon Apr 17 13:28:26 2006
@@ -13,11 +13,17 @@
 @REM --
 @REM -- This file for use on Windows systems
 @REM ---------------------------------------------------------
-
+@echo off
 rem set DERBY_INSTALL=
- 
-@if !"%CLASSPATH%"==! call "%DERBY_INSTALL%"/frameworks/NetworkServer/bin/setNetworkClientCP.bat
-@if "%CLASSPATH%" == "" call "%DERBY_INSTALL%"/frameworks/NetworkServer/bin/setNetworkClientCP.bat
+
+@if "%DERBY_HOME%"=="" set DERBY_HOME=%DERBY_INSTALL%
+@if "%DERBY_HOME%"=="" goto noderbyhome
+
+@if "%JAVA_HOME%"=="" goto nojavahome
+@if not exist "%JAVA_HOME%\bin\java.exe" goto nojavahome
+
+@if !"%CLASSPATH%"==! call "%DERBY_HOME%"/frameworks/NetworkServer/bin/setNetworkClientCP.bat
+@if "%CLASSPATH%" == "" call "%DERBY_HOME%"/frameworks/NetworkServer/bin/setNetworkClientCP.bat
 
 set IJ_HOST=localhost
 set IJ_PORT=1527
@@ -28,10 +34,23 @@
 @REM -- start ij
 @REM -- host, port, user and password may need to be changed
 @REM ---------------------------------------------------------
-java -Dij.driver=org.apache.derby.jdbc.ClientDriver -Dij.protocol=jdbc:derby://%IJ_HOST%:%IJ_PORT%/
-Dij.user=%IJ_USER% -Dij.password=%IJ_PASSWORD%  org.apache.derby.tools.ij
+@echo on
+"%JAVA_HOME%\bin\java" -Dij.driver=org.apache.derby.jdbc.ClientDriver -Dij.protocol=jdbc:derby://%IJ_HOST%:%IJ_PORT%/
-Dij.user=%IJ_USER% -Dij.password=%IJ_PASSWORD%  org.apache.derby.tools.ij
+@goto end
 
 @REM ---------------------------------------------------------
 @REM -- To use a different JVM with a different syntax, simply edit
 @REM -- this file
 @REM ---------------------------------------------------------
 
+:nojavahome
+echo JAVA_HOME not set or could not find java executable in JAVA_HOME.
+echo Please set JAVA_HOME to the location of a valid Java installation.
+goto end
+
+:noderbyhome
+echo DERBY_HOME or DERBY_INSTALL not set. Set one of these variables
+echo to the location of your Derby installation.
+goto end
+
+:end
\ No newline at end of file

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/ij.ksh
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/ij.ksh?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/ij.ksh (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/ij.ksh Mon Apr 17 13:28:26 2006
@@ -13,8 +13,27 @@
 
 # DERBY_INSTALL=
 
+DERBY_HOME=${DERBY_HOME:-$DERBY_INSTALL}
+
+[ -z "$DERBY_HOME" ] && {
+  echo "\$DERBY_HOME or \$DERBY_INSTALL not set. Please set one of these variables"
+  echo "to the location of your Derby installation."
+  exit 1
+}
+
+[ -z "$JAVA_HOME" ] && {
+  [ -x /usr/java/bin/java ] && {
+    JAVA_HOME=/usr/java
+  }
+  [ -z "$JAVA_HOME" ] && {
+    echo "JAVA_HOME not set. Please set JAVA_HOME to the location of your Java"
+    echo "installation."
+    exit 1
+  }
+} 
+
 [ -z "$CLASSPATH" ] && {
-  . "$DERBY_INSTALL"/frameworks/NetworkServer/bin/setNetworkClientCP.ksh
+  . "$DERBY_HOME"/frameworks/NetworkServer/bin/setNetworkClientCP.ksh
 }
  
 export IJ_HOST=localhost
@@ -25,7 +44,7 @@
 # ---------------------------------------------------------
 # -- start ij
 # ---------------------------------------------------------
-java -Dij.driver=org.apache.derby.jdbc.ClientDriver -Dij.protocol=jdbc:derby://$IJ_HOST:$IJ_PORT/
-Dij.user=$IJ_USER -Dij.password=$IJ_PASSWORD  org.apache.derby.tools.ij
+"$JAVA_HOME/bin/java" -Dij.driver=org.apache.derby.jdbc.ClientDriver -Dij.protocol=jdbc:derby://$IJ_HOST:$IJ_PORT/
-Dij.user=$IJ_USER -Dij.password=$IJ_PASSWORD  org.apache.derby.tools.ij
 
 # ---------------------------------------------------------
 # -- To use a different JVM with a different syntax, simply edit

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkClientCP.bat
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkClientCP.bat?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkClientCP.bat (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkClientCP.bat Mon Apr 17 13:28:26
2006
@@ -3,15 +3,26 @@
 @REM -- for use with Derby products in Network Server mode
 @REM --
 @REM -- To use this script from other locations, change the 
-@REM -- value assigned to DERBY_INSTALL to be an absolute path 
-@REM -- (set DERBY_INSTALL=C:\derby) instead of the current relative path
+@REM -- value assigned to DERBY_HOME to be an absolute path 
+@REM -- (set DERBY_HOME=C:\derby) instead of the current relative path
 @REM --
 @REM -- This file for use on Windows systems
 @REM -- 
 @REM ---------------------------------------------------------
 
-rem set DERBY_INSTALL=
+@rem set DERBY_INSTALL=
 
-FOR %%X in ("%DERBY_INSTALL%") DO SET DERBY_INSTALL=%%~sX
+@if "%DERBY_HOME%"=="" set DERBY_HOME=%DERBY_INSTALL%
+@if "%DERBY_HOME%"=="" goto noderbyhome
 
-set CLASSPATH=%DERBY_INSTALL%\lib\derbyclient.jar;%DERBY_INSTALL%\lib\derbytools.jar;%CLASSPATH%
+@FOR %%X in ("%DERBY_HOME%") DO SET DERBY_HOME=%%~sX
+
+set CLASSPATH=%DERBY_HOME%\lib\derbyclient.jar;%DERBY_HOME%\lib\derbytools.jar;%CLASSPATH%
+@goto end
+
+:noderbyhome
+@echo DERBY_HOME or DERBY_INSTALL not set. Set one of these variables
+@echo to the location of your Derby installation.
+@goto end
+
+:end
\ No newline at end of file

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkClientCP.ksh
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkClientCP.ksh?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkClientCP.ksh (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkClientCP.ksh Mon Apr 17 13:28:26
2006
@@ -11,4 +11,12 @@
 # ---------------------------------------------------------
 # DERBY_INSTALL=
 
-export CLASSPATH="${DERBY_INSTALL}/lib/derbyclient.jar:${DERBY_INSTALL}/lib/derbytools.jar:${CLASSPATH}"
+DERBY_HOME=${DERBY_HOME:-$DERBY_INSTALL}
+
+[ -z "$DERBY_HOME" ] && {
+  echo "\$DERBY_HOME or \$DERBY_INSTALL not set. Please set one of these variables"
+  echo "to the location of your Derby installation."
+  exit 1
+}
+
+export CLASSPATH="${DERBY_HOME}/lib/derbyclient.jar:${DERBY_HOME}/lib/derbytools.jar:${CLASSPATH}"

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkServerCP.bat
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkServerCP.bat?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkServerCP.bat (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkServerCP.bat Mon Apr 17 13:28:26
2006
@@ -10,8 +10,18 @@
 @REM -- 
 @REM ---------------------------------------------------------
 
-rem set DERBY_INSTALL=
+@rem set DERBY_INSTALL=
 
-FOR %%X in ("%DERBY_INSTALL%") DO SET DERBY_INSTALL=%%~sX
+@if "%DERBY_HOME%"=="" set DERBY_HOME=%DERBY_INSTALL%
+@if "%DERBY_HOME%"=="" goto noderbyhome
 
-set CLASSPATH=%DERBY_INSTALL%\lib\derby.jar;%DERBY_INSTALL%\lib\derbytools.jar;%DERBY_INSTALL%\lib\derbynet.jar;%CLASSPATH%
+@FOR %%X in ("%DERBY_HOME%") DO SET DERBY_INSTALL=%%~sX
+
+set CLASSPATH=%DERBY_HOME%\lib\derby.jar;%DERBY_HOME%\lib\derbytools.jar;%DERBY_HOME%\lib\derbynet.jar;%CLASSPATH%
+@goto end
+
+:noderbyhome
+@echo DERBY_HOME or DERBY_INSTALL not set. Set one of these variables
+@echo to the location of your Derby installation.
+
+:end
\ No newline at end of file

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkServerCP.ksh
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkServerCP.ksh?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkServerCP.ksh (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/setNetworkServerCP.ksh Mon Apr 17 13:28:26
2006
@@ -11,4 +11,12 @@
 # ---------------------------------------------------------
 # DERBY_INSTALL=
 
-export CLASSPATH="${DERBY_INSTALL}/lib/derby.jar:${DERBY_INSTALL}/lib/derbytools.jar:${DERBY_INSTALL}/lib/derbynet.jar:${CLASSPATH}"
+DERBY_HOME=${DERBY_HOME:-$DERBY_INSTALL}
+
+[ -z "$DERBY_HOME" ] && {
+  echo "\$DERBY_HOME or \$DERBY_INSTALL not set. Please set one of these variables"
+  echo "to the location of your Derby installation."
+  exit 1
+}
+
+export CLASSPATH="${DERBY_HOME}/lib/derby.jar:${DERBY_HOME}/lib/derbytools.jar:${DERBY_HOME}/lib/derbynet.jar:${CLASSPATH}"

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/startNetworkServer.bat
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/startNetworkServer.bat?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/startNetworkServer.bat (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/startNetworkServer.bat Mon Apr 17 13:28:26
2006
@@ -4,11 +4,14 @@
 @echo off
 @rem set DERBY_INSTALL=
 
+@if "%DERBY_HOME%"=="" set DERBY_HOME=%DERBY_INSTALL%
+@if "%DERBY_HOME%"=="" goto noderbyhome
 
-@if !"%CLASSPATH%"==! call "%DERBY_INSTALL%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
-@if "%CLASSPATH%" == "" call "%DERBY_INSTALL%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
+@if "%JAVA_HOME%"=="" goto nojavahome
+@if not exist "%JAVA_HOME%\bin\java.exe" goto nojavahome
 
-if   "%JAVA_HOME%" == "" goto setjavaMsg
+@if !"%CLASSPATH%"==! call "%DERBY_HOME%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
+@if "%CLASSPATH%" == "" call "%DERBY_HOME%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
 
 :set_host
 
@@ -45,7 +48,7 @@
 @REM ---------------------------------------------------------
 @REM -- start Derby as a Network server
 @REM ---------------------------------------------------------
-%JAVA_HOME%\bin\java org.apache.derby.drda.NetworkServerControl start -h %derbyHost% -p %derbyPort%
+"%JAVA_HOME%\bin\java" org.apache.derby.drda.NetworkServerControl start -h %derbyHost% -p
%derbyPort%
 
 goto end
 @REM ---------------------------------------------------------
@@ -53,8 +56,15 @@
 @REM -- this file
 @REM ---------------------------------------------------------
 
-:setJavaMsg
-echo Please set JAVA_HOME in order to start the Network Server
+:nojavahome
+echo JAVA_HOME not set or could not find java executable in JAVA_HOME.
+echo Please set JAVA_HOME to the location of a valid Java installation.
+goto end
+
+:noderbyhome
+echo DERBY_HOME or DERBY_INSTALL not set. Set one of these variables
+echo to the location of your Derby installation.
+goto end
 
 :end
 set derbyPort=

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/startNetworkServer.ksh
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/startNetworkServer.ksh?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/startNetworkServer.ksh (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/startNetworkServer.ksh Mon Apr 17 13:28:26
2006
@@ -16,14 +16,29 @@
 
 # DERBY_INSTALL=
 
+DERBY_HOME=${DERBY_HOME:-$DERBY_INSTALL}
+
+[ -z "$DERBY_HOME" ] && {
+  echo "\$DERBY_HOME or \$DERBY_INSTALL not set. Please set one of these variables"
+  echo "to the location of your Derby installation."
+  exit 1
+} 
+
+[ -z "$JAVA_HOME" ] && {
+  [ -x /usr/java/bin/java ] && {
+    JAVA_HOME=/usr/java
+  }
+  [ -z "$JAVA_HOME" ] && {
+    echo "JAVA_HOME not set. Please set JAVA_HOME to the location of your Java"
+    echo "installation."
+    exit 1
+  }
+}
+
 [ -z "$CLASSPATH" ] && {
-  . "$DERBY_INSTALL"/frameworks/NetworkServer/bin/setNetworkServerCP.ksh
+  . "$DERBY_HOME"/frameworks/NetworkServer/bin/setNetworkServerCP.ksh
 }
 
-if [ -z "$JAVA_HOME" ]
-then
-   JAVA_HOME=/usr/java
-fi
 
 # ---------------------------------------------------------
 # -- Determine the host and port to use by:
@@ -52,7 +67,7 @@
    DERBY_SERVER_PORT=1527
 fi
 
-$JAVA_HOME/bin/java org.apache.derby.drda.NetworkServerControl start -h $DERBY_SERVER_HOST
-p $DERBY_SERVER_PORT
+"$JAVA_HOME/bin/java" org.apache.derby.drda.NetworkServerControl start -h $DERBY_SERVER_HOST
-p $DERBY_SERVER_PORT
 
 # ---------------------------------------------------------
 # -- To use a different JVM with a different syntax, simply edit

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/stopNetworkServer.bat
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/stopNetworkServer.bat?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/stopNetworkServer.bat (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/stopNetworkServer.bat Mon Apr 17 13:28:26
2006
@@ -11,11 +11,14 @@
 @echo off
 @rem set DERBY_INSTALL=
 
+@if "%DERBY_HOME%"=="" set DERBY_HOME=%DERBY_INSTALL%
+@if "%DERBY_HOME%"=="" goto noderbyhome
 
-@if !"%CLASSPATH%"==! call "%DERBY_INSTALL%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
-@if "%CLASSPATH%" == "" call "%DERBY_INSTALL%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
+@if "%JAVA_HOME%"=="" goto nojavahome
+@if not exist "%JAVA_HOME%\bin\java.exe" goto nojavahome
 
-if   "%JAVA_HOME%" == "" goto setjavaMsg
+@if !"%CLASSPATH%"==! call "%DERBY_HOME%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
+@if "%CLASSPATH%" == "" call "%DERBY_HOME%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
 
 :set_host
 
@@ -60,8 +63,15 @@
 @REM -- this file
 @REM ---------------------------------------------------------
 
-:setJavaMsg
-echo Please set JAVA_HOME in order to start the Network Server
+:nojavahome
+echo JAVA_HOME not set or could not find java executable in JAVA_HOME.
+echo Please set JAVA_HOME to the location of a valid Java installation.
+goto end
+
+:noderbyhome
+echo DERBY_HOME or DERBY_INSTALL not set. Set one of these variables
+echo to the location of your Derby installation.
+goto end
 
 :end
 set derbyPort=

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/stopNetworkServer.ksh
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/stopNetworkServer.ksh?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/stopNetworkServer.ksh (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/stopNetworkServer.ksh Mon Apr 17 13:28:26
2006
@@ -16,14 +16,28 @@
 
 # DERBY_INSTALL=
 
-[ -z "$CLASSPATH" ] && {
-  . "$DERBY_INSTALL"/frameworks/NetworkServer/bin/setNetworkServerCP.ksh
+DERBY_HOME=${DERBY_HOME:-$DERBY_INSTALL}
+
+[ -z "$DERBY_HOME" ] && {
+  echo "\$DERBY_HOME or \$DERBY_INSTALL not set. Please set one of these variables"
+  echo "to the location of your Derby installation."
+  exit 1
 }
 
-if [ -z "$JAVA_HOME" ]
-then
-   JAVA_HOME=/usr/java
-fi
+[ -z "$JAVA_HOME" ] && {
+  [ -x /usr/java/bin/java ] && {
+    JAVA_HOME=/usr/java
+  }
+  [ -z "$JAVA_HOME" ] && {
+    echo "JAVA_HOME not set. Please set JAVA_HOME to the location of your Java"
+    echo "installation."
+    exit 1
+  }
+}
+ 
+[ -z "$CLASSPATH" ] && {
+  . "$DERBY_HOME"/frameworks/NetworkServer/bin/setNetworkServerCP.ksh
+}
 
 # ---------------------------------------------------------
 # -- Determine the host and port to use by:
@@ -52,7 +66,7 @@
    DERBY_SERVER_PORT=1527
 fi
 
-$JAVA_HOME/bin/java org.apache.derby.drda.NetworkServerControl shutdown -h $DERBY_SERVER_HOST
-p $DERBY_SERVER_PORT
+"$JAVA_HOME/bin/java" org.apache.derby.drda.NetworkServerControl shutdown -h $DERBY_SERVER_HOST
-p $DERBY_SERVER_PORT
 
 # ---------------------------------------------------------
 # -- To use a different JVM with a different syntax, simply edit

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/sysinfo.bat
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/sysinfo.bat?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/sysinfo.bat (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/sysinfo.bat Mon Apr 17 13:28:26 2006
@@ -13,20 +13,38 @@
 @REM -- 
 @REM -- This file for use on Windows systems
 @REM ---------------------------------------------------------
-
+@echo off
 rem set DERBY_INSTALL=
- 
-@if !"%CLASSPATH%"==! call "%DERBY_INSTALL%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
-@if "%CLASSPATH%" == "" call "%DERBY_INSTALL%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
+
+@if "%DERBY_HOME%"=="" set DERBY_HOME=%DERBY_INSTALL%
+@if "%DERBY_HOME%"=="" goto noderbyhome
+
+@if "%JAVA_HOME%"=="" goto nojavahome
+@if not exist "%JAVA_HOME%\bin\java.exe" goto nojavahome
+
+@if !"%CLASSPATH%"==! call "%DERBY_HOME%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
+@if "%CLASSPATH%" == "" call "%DERBY_HOME%"/frameworks/NetworkServer/bin/setNetworkServerCP.bat
 
 @REM ---------------------------------------------------------
 @REM -- start sysinfo
 @REM ---------------------------------------------------------
-java org.apache.derby.drda.NetworkServerControl sysinfo %*
+"%JAVA_HOME%\bin\java" org.apache.derby.drda.NetworkServerControl sysinfo %*
+@GOTO end
 
 @REM ---------------------------------------------------------
 @REM -- To use a different JVM with a different syntax, simply edit
 @REM -- this file
 @REM ---------------------------------------------------------
 
+:nojavahome
+echo JAVA_HOME not set or could not find java executable in JAVA_HOME.
+echo Please set JAVA_HOME to the location of a valid Java installation.
+goto end
+
+:noderbyhome
+echo DERBY_HOME or DERBY_INSTALL not set. Set one of these variables
+echo to the location of your Derby installation.
+goto end
+
+:end
 

Modified: db/derby/code/trunk/frameworks/NetworkServer/bin/sysinfo.ksh
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/NetworkServer/bin/sysinfo.ksh?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/NetworkServer/bin/sysinfo.ksh (original)
+++ db/derby/code/trunk/frameworks/NetworkServer/bin/sysinfo.ksh Mon Apr 17 13:28:26 2006
@@ -19,14 +19,33 @@
 
 # DERBY_INSTALL=
 
+DERBY_HOME=${DERBY_HOME:-$DERBY_INSTALL}
+
+[ -z "$DERBY_HOME" ] && {
+  echo "\$DERBY_HOME or \$DERBY_INSTALL not set. Please set one of these variables"
+  echo "to the location of your Derby installation."
+  exit 1
+}
+
+[ -z "$JAVA_HOME" ] && {
+  [ -x /usr/java/bin/java ] && {
+    JAVA_HOME=/usr/java
+  }
+  [ -z "$JAVA_HOME" ] && {
+    echo "JAVA_HOME not set. Please set JAVA_HOME to the location of your Java"
+    echo "installation."
+    exit 1
+  }
+}
+ 
 [ -z "$CLASSPATH" ] && {
-  . "$DERBY_INSTALL"/frameworks/NetworkServer/bin/setNetworkServerCP.ksh
+  . "$DERBY_HOME"/frameworks/NetworkServer/bin/setNetworkServerCP.ksh
 }
 
 # ---------------------------------------------------------
 # -- start sysinfo
 # ---------------------------------------------------------
-java org.apache.derby.drda.NetworkServerControl sysinfo $*
+"$JAVA_HOME/bin/java" org.apache.derby.drda.NetworkServerControl sysinfo $*
 # ---------------------------------------------------------
 # -- To use a different JVM with a different syntax, simply edit
 # -- this file

Modified: db/derby/code/trunk/frameworks/embedded/bin/dblook.bat
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/embedded/bin/dblook.bat?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/embedded/bin/dblook.bat (original)
+++ db/derby/code/trunk/frameworks/embedded/bin/dblook.bat Mon Apr 17 13:28:26 2006
@@ -10,19 +10,37 @@
 @REM --
 @REM -- This file for use on Windows systems
 @REM ---------------------------------------------------------
-
+@echo off
 rem set DERBY_INSTALL=
- 
-@if !"%CLASSPATH%"==! call "%DERBY_INSTALL%"/frameworks/embedded/bin/setEmbeddedCP.bat
-@if "%CLASSPATH%" == "" call "%DERBY_INSTALL%"/frameworks/embedded/bin/setEmbeddedCP.bat
+
+@if "%DERBY_HOME%"=="" set DERBY_HOME=%DERBY_INSTALL%
+@if "%DERBY_HOME%"=="" goto noderbyhome
+
+@if "%JAVA_HOME%"=="" goto nojavahome
+@if not exist "%JAVA_HOME%\bin\java.exe" goto nojavahome
+
+@if !"%CLASSPATH%"==! call "%DERBY_HOME%"/frameworks/embedded/bin/setEmbeddedCP.bat
+@if "%CLASSPATH%" == "" call "%DERBY_HOME%"/frameworks/embedded/bin/setEmbeddedCP.bat
 
 @REM ---------------------------------------------------------
 @REM -- start dblook
 @REM ---------------------------------------------------------
-java org.apache.derby.tools.dblook %*
+"%JAVA_HOME%\bin\java" org.apache.derby.tools.dblook %*
+@GOTO end
 
 @REM ---------------------------------------------------------
 @REM -- To use a different JVM with a different syntax, simply edit
 @REM -- this file
 @REM ---------------------------------------------------------
 
+:nojavahome
+echo JAVA_HOME not set or could not find java executable in JAVA_HOME.
+echo Please set JAVA_HOME to the location of a valid Java installation.
+goto end
+
+:noderbyhome
+echo DERBY_HOME or DERBY_INSTALL not set. Set one of these variables
+echo to the location of your Derby installation.
+goto end
+
+:end
\ No newline at end of file

Modified: db/derby/code/trunk/frameworks/embedded/bin/dblook.ksh
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/embedded/bin/dblook.ksh?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/embedded/bin/dblook.ksh (original)
+++ db/derby/code/trunk/frameworks/embedded/bin/dblook.ksh Mon Apr 17 13:28:26 2006
@@ -13,14 +13,33 @@
 
 # DERBY_INSTALL=
 
+DERBY_HOME=${DERBY_HOME:-$DERBY_INSTALL}
+
+[ -z "$DERBY_HOME" ] && {
+  echo "\$DERBY_HOME or \$DERBY_INSTALL not set. Please set one of these variables"
+  echo "to the location of your Derby installation."
+  exit 1
+}
+
+[ -z "$JAVA_HOME" ] && {
+  [ -x /usr/java/bin/java ] && {
+    JAVA_HOME=/usr/java
+  }
+  [ -z "$JAVA_HOME" ] && {
+    echo "JAVA_HOME not set. Please set JAVA_HOME to the location of your Java"
+    echo "installation."
+    exit 1
+  }
+}
+ 
 [ -z "$CLASSPATH" ] && {
-  . "$DERBY_INSTALL"/frameworks/embedded/bin/setEmbeddedCP.ksh
+  . "$DERBY_HOME"/frameworks/embedded/bin/setEmbeddedCP.ksh
 }
  
 # ---------------------------------------------------------
 # -- start dblook
 # ---------------------------------------------------------
-java org.apache.derby.tools.dblook $@
+"$JAVA_HOME/bin/java" org.apache.derby.tools.dblook $@
 
 # ---------------------------------------------------------
 # -- To use a different JVM with a different syntax, simply edit

Modified: db/derby/code/trunk/frameworks/embedded/bin/ij.bat
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/embedded/bin/ij.bat?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/embedded/bin/ij.bat (original)
+++ db/derby/code/trunk/frameworks/embedded/bin/ij.bat Mon Apr 17 13:28:26 2006
@@ -10,20 +10,37 @@
 @REM --
 @REM -- This file for use on Windows systems
 @REM ---------------------------------------------------------
-
+@echo off
 rem set DERBY_INSTALL=
- 
+
+@if "%DERBY_HOME%"=="" set DERBY_HOME=%DERBY_INSTALL%
+@if "%DERBY_HOME%"=="" goto noderbyhome
+
+@if "%JAVA_HOME%"=="" goto nojavahome
+@if not exist "%JAVA_HOME%\bin\java.exe" goto nojavahome
+
 @if !"%CLASSPATH%"==! call "%DERBY_INSTALL%"/frameworks/embedded/bin/setEmbeddedCP.bat
 @if "%CLASSPATH%" == "" call "%DERBY_INSTALL%"/frameworks/embedded/bin/setEmbeddedCP.bat
 
 @REM ---------------------------------------------------------
 @REM -- start ij
 @REM ---------------------------------------------------------
-java -Dij.protocol=jdbc:derby: org.apache.derby.tools.ij
-
+"%JAVA_HOME%\bin\java" -Dij.protocol=jdbc:derby: org.apache.derby.tools.ij
+@goto end
 
 @REM ---------------------------------------------------------
 @REM -- To use a different JVM with a different syntax, simply edit
 @REM -- this file
 @REM ---------------------------------------------------------
 
+:nojavahome
+echo JAVA_HOME not set or could not find java executable in JAVA_HOME.
+echo Please set JAVA_HOME to the location of a valid Java installation.
+goto end
+
+:noderbyhome
+echo DERBY_HOME or DERBY_INSTALL not set. Set one of these variables
+echo to the location of your Derby installation.
+goto end
+
+:end
\ No newline at end of file

Modified: db/derby/code/trunk/frameworks/embedded/bin/ij.ksh
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/embedded/bin/ij.ksh?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/embedded/bin/ij.ksh (original)
+++ db/derby/code/trunk/frameworks/embedded/bin/ij.ksh Mon Apr 17 13:28:26 2006
@@ -13,14 +13,33 @@
 
 # DERBY_INSTALL=
 
+DERBY_HOME=${DERBY_HOME:-$DERBY_INSTALL}
+
+[ -z "$DERBY_HOME" ] && {
+  echo "\$DERBY_HOME or \$DERBY_INSTALL not set. Please set one of these variables"
+  echo "to the location of your Derby installation."
+  exit 1
+}
+
+[ -z "$JAVA_HOME" ] && {
+  [ -x /usr/java/bin/java ] && {
+    JAVA_HOME=/usr/java
+  }
+  [ -z "$JAVA_HOME" ] && {
+    echo "JAVA_HOME not set. Please set JAVA_HOME to the location of your Java"
+    echo "installation."
+    exit 1
+  }
+}
+ 
 [ -z "$CLASSPATH" ] && {
-  . "$DERBY_INSTALL"/frameworks/embedded/bin/setEmbeddedCP.ksh
+  . "$DERBY_HOME"/frameworks/embedded/bin/setEmbeddedCP.ksh
 }
  
 # ---------------------------------------------------------
 # -- start ij
 # ---------------------------------------------------------
-java -Dij.protocol=jdbc:derby: org.apache.derby.tools.ij
+"$JAVA_HOME/bin/java" -Dij.protocol=jdbc:derby: org.apache.derby.tools.ij
 
 # ---------------------------------------------------------
 # -- To use a different JVM with a different syntax, simply edit

Modified: db/derby/code/trunk/frameworks/embedded/bin/setEmbeddedCP.bat
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/embedded/bin/setEmbeddedCP.bat?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/embedded/bin/setEmbeddedCP.bat (original)
+++ db/derby/code/trunk/frameworks/embedded/bin/setEmbeddedCP.bat Mon Apr 17 13:28:26 2006
@@ -10,8 +10,19 @@
 @REM -- 
 @REM ---------------------------------------------------------
 
-rem set DERBY_INSTALL=
+@rem set DERBY_INSTALL=
 
-FOR %%X in ("%DERBY_INSTALL%") DO SET DERBY_INSTALL=%%~sX
+@if "%DERBY_HOME%"=="" set DERBY_HOME=%DERBY_INSTALL%
+@if "%DERBY_HOME%"=="" goto noderbyhome
 
-set CLASSPATH=%DERBY_INSTALL%\lib\derby.jar;%DERBY_INSTALL%\lib\derbytools.jar;%CLASSPATH%
+@FOR %%X in ("%DERBY_HOME%") DO SET DERBY_HOME=%%~sX
+
+set CLASSPATH=%DERBY_HOME%\lib\derby.jar;%DERBY_HOME%\lib\derbytools.jar;%CLASSPATH%
+@goto end
+
+:noderbyhome
+@echo DERBY_HOME or DERBY_INSTALL not set. Set one of these variables
+@echo to the location of your Derby installation.
+@goto end
+
+:end
\ No newline at end of file

Modified: db/derby/code/trunk/frameworks/embedded/bin/setEmbeddedCP.ksh
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/embedded/bin/setEmbeddedCP.ksh?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/embedded/bin/setEmbeddedCP.ksh (original)
+++ db/derby/code/trunk/frameworks/embedded/bin/setEmbeddedCP.ksh Mon Apr 17 13:28:26 2006
@@ -12,4 +12,12 @@
 
 # DERBY_INSTALL=
 
+DERBY_HOME=${DERBY_HOME:-$DERBY_INSTALL}
+
+[ -z "$DERBY_HOME" ] && {
+  echo "\$DERBY_HOME or \$DERBY_INSTALL not set. Please set one of these variables"
+  echo "to the location of your Derby installation."
+  exit 1
+}
+
 export CLASSPATH="${DERBY_INSTALL}/lib/derby.jar:${DERBY_INSTALL}/lib/derbytools.jar:${CLASSPATH}"

Modified: db/derby/code/trunk/frameworks/embedded/bin/sysinfo.bat
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/embedded/bin/sysinfo.bat?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/embedded/bin/sysinfo.bat (original)
+++ db/derby/code/trunk/frameworks/embedded/bin/sysinfo.bat Mon Apr 17 13:28:26 2006
@@ -13,16 +13,23 @@
 @REM -- 
 @REM -- This file for use on Windows systems
 @REM ---------------------------------------------------------
+@echo off
+@rem set DERBY_INSTALL=
+
+@if "%DERBY_HOME%"=="" set DERBY_HOME=%DERBY_INSTALL%
+@if "%DERBY_HOME%"=="" goto noderbyhome
+
+@if "%JAVA_HOME%"=="" goto nojavahome
+@if not exist "%JAVA_HOME%\bin\java.exe" goto nojavahome
 
-rem set DERBY_INSTALL=
- 
 @if !"%CLASSPATH%"==! call "%DERBY_INSTALL%"/frameworks/embedded/bin/setEmbeddedCP.bat
 @if "%CLASSPATH%" == "" call "%DERBY_INSTALL%"/frameworks/embedded/bin/setEmbeddedCP.bat
 
 @REM ---------------------------------------------------------
 @REM -- start sysinfo
 @REM ---------------------------------------------------------
-java org.apache.derby.tools.sysinfo
+"%JAVA_HOME%\bin\java" org.apache.derby.tools.sysinfo
+@GOTO end
 
 @REM ---------------------------------------------------------
 @REM -- To use Microsoft's JView JVM, use the following command
@@ -34,4 +41,14 @@
 @REM -- this file
 @REM ---------------------------------------------------------
 
+:nojavahome
+echo JAVA_HOME not set or could not find java executable in JAVA_HOME.
+echo Please set JAVA_HOME to the location of a valid Java installation.
+goto end
+
+:noderbyhome
+echo DERBY_HOME or DERBY_INSTALL not set. Set one of these variables
+echo to the location of your Derby installation.
+goto end
 
+:end
\ No newline at end of file

Modified: db/derby/code/trunk/frameworks/embedded/bin/sysinfo.ksh
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/frameworks/embedded/bin/sysinfo.ksh?rev=394769&r1=394768&r2=394769&view=diff
==============================================================================
--- db/derby/code/trunk/frameworks/embedded/bin/sysinfo.ksh (original)
+++ db/derby/code/trunk/frameworks/embedded/bin/sysinfo.ksh Mon Apr 17 13:28:26 2006
@@ -17,14 +17,33 @@
 
 # DERBY_INSTALL=
 
+DERBY_HOME=${DERBY_HOME:-$DERBY_INSTALL}
+
+[ -z "$DERBY_HOME" ] && {
+  echo "\$DERBY_HOME or \$DERBY_INSTALL not set. Please set one of these variables"
+  echo "to the location of your Derby installation."
+  exit 1
+}
+
+[ -z "$JAVA_HOME" ] && {
+  [ -x /usr/java/bin/java ] && {
+    JAVA_HOME=/usr/java
+  }
+  [ -z "$JAVA_HOME" ] && {
+    echo "JAVA_HOME not set. Please set JAVA_HOME to the location of your Java"
+    echo "installation."
+    exit 1
+  }
+}
+ 
 [ -z "$CLASSPATH" ] && {
-  . "$DERBY_INSTALL"/frameworks/embedded/bin/setEmbeddedCP.ksh
+  . "$DERBY_HOME"/frameworks/embedded/bin/setEmbeddedCP.ksh
 }
  
 # ---------------------------------------------------------
 # -- start sysinfo
 # ---------------------------------------------------------
-java org.apache.derby.tools.sysinfo
+"$JAVA_HOME/bin/java" org.apache.derby.tools.sysinfo
 
 # ---------------------------------------------------------
 # -- To use a different JVM with a different syntax, simply edit



Mime
View raw message