2017-03-06 1453 views
2

我試圖運行一個啓動腳本,但是我得到一個錯誤,指出CATALINA_HOME包含冒號,我發現它的確如此,但是這是tomcat的路徑。無法啓動,因爲CATALINA_HOME包含冒號(:)字符

在其他問題中,我看到設置CATALINA_HOME的examples包含冒號,所以我沒有看到這裏有什麼不同。

我在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 

以前有人遇到過這個嗎?

回答

1

同樣的問題與此消息:

[email protected] 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不使用冒號:這樣的:

enter image description here

之後,這裏是工作的結果:

[email protected] 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 

[email protected] 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; 

因此,移除冒號解決了這個問題。

0

不是直接運行bat文件,而是嘗試在該目錄中打開一個命令窗口(按住ctrl鍵並點擊「在此處打開commad窗口」,如果不知道的話,右鍵單擊該文件夾) :

catalina.bat run

看看是否有效。

+0

這不回答這個問題的問題 – HDJEMAI

1

如果您在Windows機器上使用git bash中,你仍然需要輸入「./startup.bat」而不是「./startup.sh」

相關問題