start.bat 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. :: The first param is profile name, e.g., ma_test
  2. :: The second param is JAppID, if not set, the default value is 'MonitorAgent'
  3. @echo off
  4. title=UAV
  5. set profile=agent
  6. if not [%1] == [] set profile=%1
  7. set appID=MonitorAgent
  8. if not [%2] == [] set appID=%2
  9. if not "%JAVA_HOME%" == "" set executeJava="%JAVA_HOME%/bin/java"
  10. cd ..
  11. if not exist C:\Windows\System32\Packet.dll (move lib\Packet.dll C:\Windows\System32)
  12. if not exist C:\Windows\System32\wpcap.dll (move lib\wpcap.dll C:\Windows\System32)
  13. if not exist C:\Windows\System32\drivers\npf.sys (move lib\npf.sys C:\Windows\System32\drivers)
  14. set CLASSPATH=bin/com.creditease.uav.base-1.0-boot.jar
  15. set javaAgent="-javaagent:../uavmof/com.creditease.uav.agent/com.creditease.uav.monitorframework.agent-1.0-agent.jar"
  16. java -version 2>java.version
  17. for /f "tokens=3 delims= " %%i in (java.version) do (
  18. set FLAG=%%i
  19. goto :next
  20. )
  21. :next
  22. set JAVA_VERSION=%FLAG:~1,-1%
  23. set JudgeFlag=%JAVA_VERSION:~0,2%
  24. if "%JudgeFlag%" == "9." (
  25. set javaOpts=-server -Xms64m -Xmx256m -Djdk.attach.allowAttachSelf=true -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=.) else (
  26. set javaOpts=-server -Xms64m -Xmx256m -XX:-UseSplitVerifier -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 -XX:CMSIncrementalDutyCycle=10 -XX:+UseParNewGC)
  27. %executeJava% %javaAgent% %javaOpts% -Djava.library.path=./lib -DNetCardIndex=0 -DJAppID=%appID% -DJAppGroup=UAV -classpath "%CLASSPATH%" com.creditease.mscp.boot.MSCPBoot -p %profile%