我正在尝试运行启动脚本,但收到一个错误消息:CATALINA_HOME包含冒号,我发现确实如此,但这是tomcat的路径。

在其他问题中,我看到了examples设置包含冒号的CATALINA_HOME的信息,因此这里看不到有什么不同。

我在Windows计算机上,使用MINGW64,并且设置了JAVA_HOME。

$ ./startup.sh
Using CATALINA_HOME:   C:\projects\apache-tomcat-8.5.11
Unable to start as CATALINA_HOME contains a colon (:) character


有人遇到过吗?

最佳答案

这则讯息对我来说同样是个问题:

user@DESKTOP-1I6N4PQ MINGW64 /g/dev
$ catalina.sh
Using CATALINA_HOME:   G:\dev\apache-tomcat-8.5.12-windows-x64
Unable to start as CATALINA_HOME contains a colon (:) character


解:


  设置CATALINA_HOME而不使用冒号:,如下所示:


tomcat - 由于CATALINA_HOME包含冒号(:)字符而无法启动-LMLPHP

之后,这是工作结果:

user@DESKTOP-1I6N4PQ MINGW64 /g/dev
$ catalina.sh
Using CATALINA_BASE:   \dev\apache-tomcat-8.5.12-windows-x64
Using CATALINA_HOME:   \dev\apache-tomcat-8.5.12-windows-x64
Using CATALINA_TMPDIR: \dev\apache-tomcat-8.5.12-windows-x64/temp
Using JRE_HOME:        C:\Program Files\Java\jdk1.8.0_121
Using CLASSPATH:       \dev\apache-tomcat-8.5.12-windows-x64/bin/bootstrap.jar:\dev\apache-tomcat   -8.5.12-windows-x64/bin/tomcat-juli.jar
Usage: catalina.sh ( commands ... )
commands:
  debug             Start Catalina in a debugger
  debug -security   Debug Catalina with a security manager
  jpda start        Start Catalina under JPDA debugger
  run               Start Catalina in the current window
  run -security     Start in the current window with security manager
  start             Start Catalina in a separate window
  start -security   Start in a separate window with security manager
  stop              Stop Catalina, waiting up to 5 seconds for the process to end
  stop n            Stop Catalina, waiting up to n seconds for the process to end
  stop -force       Stop Catalina, wait up to 5 seconds and then use kill -KILL if still running
  stop n -force     Stop Catalina, wait up to n seconds and then use kill -KILL if still running
  configtest        Run a basic syntax check on server.xml - check exit code for result
  version           What version of tomcat are you running?
Note: Waiting for the process to end and use of the -force option require that $CATALINA_PID is d   efined

user@DESKTOP-1I6N4PQ MINGW64 /g/dev
$


注意:

catalina.sh文件中,您将找到以下内容:

# Ensure that neither CATALINA_HOME nor CATALINA_BASE contains a colon
# as this is used as the separator in the classpath and Java provides no
# mechanism for escaping if the same character appears in the path.
case $CATALINA_HOME in *:*)
   echo "Using CATALINA_HOME:   $CATALINA_HOME";
   echo "Unable to start as CATALINA_HOME contains a colon (:) character";
   exit 1;


因此,去除结肠可以解决问题。

关于tomcat - 由于CATALINA_HOME包含冒号(:)字符而无法启动,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42631461/

10-16 09:21