evereveron
evereveron

Reputation: 307

Unable to start as CATALINA_HOME contains a colon (:) character

I'm trying to run a startup script but I get an error that CATALINA_HOME contains a colon, which I see that it does, however that is the path to tomcat.

In other questions I saw examples of setting CATALINA_HOME that included colons, so I don't see what's different here.

I'm on a Windows machine, using MINGW64 and I have JAVA_HOME set.

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

Anyone come across this before ?

Upvotes: 3

Views: 5006

Answers (3)

tapa nama
tapa nama

Reputation: 51

If you use git bash on Windows machine, you still need to type "./startup.bat" instead of "./startup.sh"

Upvotes: 5

HDJEMAI
HDJEMAI

Reputation: 9800

Same problem for me with this message:

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

Solution:

Set the CATALINA_HOME without using the colon : like this:

enter image description here

After that, here is the working result:

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
$

Note:

In catalina.sh file, you'll find this:

# 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;

So removing the colon solved the problem.

Upvotes: 0

Burak Bölük
Burak Bölük

Reputation: 33

Instead of directly running the bat file, try to open a command window in that directory (right click on the folder while pressing ctrl key and "Open commad window here", in case you don't know) an type this:

catalina.bat run

See if that works.

Upvotes: 0

Related Questions