无法在 windows 10 上启动 Tomcat 10.0 作为 window 服务

Unable to Start Tomcat 10.0 as window service on windows 10

无法从 window 服务以及监视器 Tomcat 启动 tomcat。

我们在哪里可以找到系统事件日志,或者我们如何显示它没有启动的原因

错误:

31-Mar-2021 12:44:54.356 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [C:\Program Files\Apache Software Foundation\Tomcat 10.0\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jre1.8.0_271\bin;D:\Software\apache-maven-3.6.3\bin;C:\Program Files\Java\jdk-15.0.2\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\ServiceNow;C:\Program Files\Git\cmd;C:\Program Files\Java\jre1.8.0_271\bin;;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\WINDOWS\ServiceProfiles\LocalService\AppData\Local\Microsoft\WindowsApps;.]
2021-03-31 16:48:41 Apache Commons Daemon procrun stderr initialized.
NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED 
Unrecognized VM option 'UseGlGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

[2021-03-31 17:18:00] [error] ( javajni.c:828 ) [25268] CreateJavaVM Failed with error [-6]
[2021-03-31 17:18:00] [error] ( javajni.c:828 ) [25268] The system could not find the environment option that was entered.
[2021-03-31 17:18:00] [debug] ( javajni.c:1087) [25268] Java worker thread finished : with status = 2
[2021-03-31 17:18:00] [error] ( prunsrv.c:1386) [ 2372] Failed to start Java
[2021-03-31 17:18:00] [error] ( prunsrv.c:1740) [ 2372] ServiceStart returned 4.
[2021-03-31 17:18:00] [debug] ( prunsrv.c:1032) [ 2372] reportServiceStatusE: dwCurrentState = 1, dwWin32ExitCode = 1066, dwWaitHint = 0, dwServiceSpecificExitCode = 4.
[2021-03-31 17:18:00] [info]  ( prunsrv.c:1808) [18004] Run service finished.
[2021-03-31 17:18:00] [info]  ( prunsrv.c:1980) [18004] Apache Commons Daemon procrun finished.

@alain.janinm 你是对的应该是 -XX:+UseG1GC 而不是 -XX:+UseGlGC 问题已解决。