jboss-cli.bat 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. @echo off
  2. rem -------------------------------------------------------------------------
  3. rem JBoss Admin CLI Script for Windows
  4. rem -------------------------------------------------------------------------
  5. rem $Id$
  6. @if not "%ECHO%" == "" echo %ECHO%
  7. @if "%OS%" == "Windows_NT" setlocal
  8. if "%OS%" == "Windows_NT" (
  9. set "DIRNAME=%~dp0%"
  10. ) else (
  11. set DIRNAME=.\
  12. )
  13. pushd %DIRNAME%..
  14. set "RESOLVED_JBOSS_HOME=%CD%"
  15. popd
  16. if "x%JBOSS_HOME%" == "x" (
  17. set "JBOSS_HOME=%RESOLVED_JBOSS_HOME%"
  18. )
  19. pushd "%JBOSS_HOME%"
  20. set "SANITIZED_JBOSS_HOME=%CD%"
  21. popd
  22. if "%RESOLVED_JBOSS_HOME%" NEQ "%SANITIZED_JBOSS_HOME%" (
  23. echo WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur.
  24. )
  25. set DIRNAME=
  26. if "%OS%" == "Windows_NT" (
  27. set "PROGNAME=%~nx0%"
  28. ) else (
  29. set "PROGNAME=jboss-cli.bat"
  30. )
  31. rem Setup JBoss specific properties
  32. set JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS%
  33. if "x%JAVA_HOME%" == "x" (
  34. set JAVA=java
  35. echo JAVA_HOME is not set. Unexpected results may occur.
  36. echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
  37. ) else (
  38. set "JAVA=%JAVA_HOME%\bin\java"
  39. )
  40. rem Find run.jar, or we can't continue
  41. if exist "%JBOSS_HOME%\jboss-modules.jar" (
  42. set "RUNJAR=%JBOSS_HOME%\jboss-modules.jar"
  43. ) else (
  44. echo Could not locate "%JBOSS_HOME%\jboss-modules.jar".
  45. echo Please check that you are in the bin directory when running this script.
  46. goto END
  47. )
  48. rem Add base package for L&F
  49. set JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=com.sun.java.swing
  50. "%JAVA%" %JAVA_OPTS% ^
  51. -jar "%JBOSS_HOME%\jboss-modules.jar" ^
  52. -mp "%JBOSS_HOME%\modules" ^
  53. org.jboss.as.cli ^
  54. %*
  55. :END
  56. if "x%NOPAUSE%" == "x" pause