start_windows.bat 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. @echo off
  2. cd "%~dp0"
  3. if exist "%~dp0local\update" (
  4. for %%D in (commons,config,configSample,local,localSample,jvm,servers,store) do (
  5. if not exist "%~dp0%%D" (
  6. mkdir "%~dp0%%D"
  7. )
  8. )
  9. if exist "%~dp0local\update\o2server\version.o2" (
  10. echo "update o2server."
  11. for %%D in (commons,config,configSample,local,localSample,jvm,servers,store) do (
  12. if exist "%~dp0local\update\o2server\%%D" (
  13. echo update %~dp0%%D
  14. xcopy "%~dp0local\update\o2server\%%D" "%~dp0%%D" /S /Y /Q
  15. )
  16. )
  17. for %%F in (console.jar,index.html,src.zip) do (
  18. if exist "%~dp0local\update\o2server\%%F" (
  19. echo update %~dp0%%F
  20. copy "%~dp0local\update\o2server\%%F" "%~dp0"
  21. )
  22. )
  23. for %%A in (start,stop,restart,console,service) do (
  24. for %%B in (_windows.bat,_linux.sh,_linux_min.sh,_macos.sh,_arm.sh,_mips.sh,_raspi.sh,_aix.sh) do (
  25. if exist "%~dp0local\update\o2server\%%A%%B" (
  26. echo update %~dp0%%A%%B
  27. copy "%~dp0local\update\o2server\%%A%%B" "%~dp0"
  28. )
  29. )
  30. )
  31. echo update %~dp0version.o2.
  32. copy "%~dp0local\update\o2server\version.o2" "%~dp0"
  33. echo clean local\update directory.
  34. rmdir /S/Q "%~dp0local\update"
  35. echo the update is complete, please restart the server.
  36. exit
  37. )
  38. )
  39. @echo on
  40. "%~dp0jvm\windows_java11\bin\java" -javaagent:"%~dp0console.jar" -server -Xms2g -Xmx4g -Dnashorn.args=--no-deprecation-warning --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime=ALL-UNNAMED --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime.arrays=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED -Duser.timezone=GMT+08 -XX:+HeapDumpOnOutOfMemoryError -jar "%~dp0console.jar"