derby_common.bat 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. @echo off
  2. @REM Licensed to the Apache Software Foundation (ASF) under one
  3. @REM or more contributor license agreements. See the NOTICE file
  4. @REM distributed with this work for additional information
  5. @REM regarding copyright ownership. The ASF licenses this file
  6. @REM to you under the Apache License, Version 2.0 (the
  7. @REM "License"); you may not use this file except in compliance
  8. @REM with the License. You may obtain a copy of the License at
  9. @REM http://www.apache.org/licenses/LICENSE-2.0
  10. @REM Unless required by applicable law or agreed to in writing,
  11. @REM software distributed under the License is distributed on an
  12. @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  13. @REM KIND, either express or implied. See the License for the
  14. @REM specific language governing permissions and limitations
  15. @REM under the License.
  16. rem %~dp0 is expanded pathname of the current script under NT
  17. set DEFAULT_DERBY_HOME=%~dp0..
  18. if "%DERBY_HOME%"=="" set DERBY_HOME=%DEFAULT_DERBY_HOME%
  19. set DEFAULT_DERBY_HOME=
  20. set _USE_CLASSPATH=yes
  21. rem Slurp the command line arguments. This loop allows for an unlimited number
  22. rem of arguments (up to the command line limit, anyway).
  23. set DERBY_CMD_LINE_ARGS=%1
  24. if ""%1""=="""" goto doneStart
  25. shift
  26. :setupArgs
  27. if ""%1""=="""" goto doneStart
  28. if ""%1""==""-noclasspath"" goto clearclasspath
  29. set DERBY_CMD_LINE_ARGS=%DERBY_CMD_LINE_ARGS% %1
  30. shift
  31. goto setupArgs
  32. rem here is there is a -noclasspath in the options
  33. :clearclasspath
  34. set _USE_CLASSPATH=no
  35. shift
  36. goto setupArgs
  37. rem This label provides a place for the argument list loop to break out
  38. rem and for NT handling to skip to.
  39. :doneStart
  40. rem check the value of DERBY_HOME
  41. if exist "%DERBY_HOME%\lib\derby.jar" goto setLocalClassPath
  42. :noDerbyHome
  43. echo DERBY_HOME is set incorrectly or derby.jar could not be located.
  44. echo Please set the DERBY_HOME environment variable to the path where you installed Derby.
  45. goto endcommon
  46. :setLocalClassPath
  47. set LOCALCLASSPATH=%DERBY_HOME%/lib/derby.jar;%DERBY_HOME%/lib/derbynet.jar;%DERBY_HOME%/lib/derbyclient.jar;%DERBY_HOME%/lib/derbytools.jar;%DERBY_HOME%/lib/derbyoptionaltools.jar
  48. :checkJava
  49. set _JAVACMD=%JAVACMD%
  50. if "%JAVA_HOME%" == "" goto noJavaHome
  51. if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
  52. if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
  53. goto endcommon
  54. :noJavaHome
  55. if "%_JAVACMD%" == "" set _JAVACMD=java.exe
  56. :endcommon