tomcat procrun安装程序无法使用catalina_home路径中的空格

nwwlzxa7  于 2021-10-10  发布在  Java
关注(0)|答案(0)|浏览(204)

我正在从.zip安装tomcat,并使用service.bat文件。我注意到,如果catalina_基地或catalina_主路径中有空间,则无法正确设置。
我通过以下方式调用service.bat:

set CATALINA_HOME=C:\Program Files\Apache Software Foundation\Tomcat 10.0
set CATALINA_BASE=C:\Program Files\Apache Software Foundation\Tomcat 10.0
set JRE_HOME=C:\Program Files (x86)\Java\jre1.8.0_151
set SERVICE_STARTUP_MODE=auto

call "%CATALINA_HOME%\bin\service.bat" install

以下是service.bat输出的命令:

"C:\Program Files\Apache Software Foundation\Tomcat 10.0\bin\Tomcat10.exe" //IS//Tomcat10     
    --Description "Apache Tomcat 10.0.5 Server - https://tomcat.apache.org/"     
    --DisplayName "Apache Tomcat 10.0 Tomcat10"     
    --Install "C:\Program Files\Apache Software Foundation\Tomcat 10.0\bin\Tomcat10.exe"     
    --LogPath "C:\Program Files\Apache Software Foundation\Tomcat 10.0\logs"     
    --StdOutput auto     
    --StdError auto     
    --Classpath "C:\Program Files\Apache Software Foundation\Tomcat 10.0\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 10.0\bin\tomcat-juli.jar"     
    --Jvm "C:\Program Files (x86)\Java\jre1.8.0_151\bin\client\jvm.dll"     
    --StartMode jvm     
    --StopMode jvm     
    --StartPath "C:\Program Files\Apache Software Foundation\Tomcat 10.0"     
    --StopPath "C:\Program Files\Apache Software Foundation\Tomcat 10.0"     
    --StartClass org.apache.catalina.startup.Bootstrap     
    --StopClass org.apache.catalina.startup.Bootstrap     
    --StartParams start     
    --StopParams stop     
    --JvmOptions "-Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 10.0;-Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 10.0;-Dignore.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 10.0\endorsed;-Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 10.0\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 10.0\conf\logging.properties;"     
     --JvmOptions9 "--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"     
    --Startup "auto"     
    --JvmMs "128"     
    --JvmMx "256"

这会导致许多问题,因为jvm选项没有正确的输入,因为没有正确的引号来处理路径中的空格。我该怎么办?
仅供参考,这会导致tomcat的配置元素无法找到${catalina.home}进行日志记录和路径选择。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题