Tomcat – How to setup tomcat 7 as a server on windows 2008 server

javatomcatwindows-server-2008

I setup the tomcat7 as a service as below:

c:\Program Files (x86)\Tomcat7\apache-tomcat-7.0.32\bin>service.bat install
Installing the service 'Tomcat7' ...
Using CATALINA_HOME:    "C:\Program Files (x86)\Tomcat7\apache-tomcat-7.0.32"
Using CATALINA_BASE:    "C:\Program Files (x86)\Tomcat7\apache-tomcat-7.0.32"
Using JAVA_HOME:        "C:\Program Files (x86)\Java\jdk1.7.0_09"
Using JRE_HOME:         "C:\Program Files (x86)\Java\jdk1.7.0_09\jre"
Using JVM:              "C:\Program Files (x86)\Java\jdk1.7.0_09\jre\bin\server\
jvm.dll"

However, when I try to start the service, I Get the error below:

c:\Program Files (x86)\Tomcat7\apache-tomcat-7.0.32\bin>tomcat7.exe
%1 is not a valid Win32 application.
Failed to run service as console application

This is the file I downloaded from apache: apache-tomcat-7.0.32-windows-x64.zip. I am able to successfully start tomcat on port 8080 as a standalong thing. Meaning I go to command prompt and type startup.bat and it starts up successfully.

Question

How can I resolve this and what are the things I should be troubleshooting for?

Best Answer

There is a post on the sister site that might help you. Here is the link: https://stackoverflow.com/questions/5920051/installing-tomcat-7-as-service-on-windows-server-2008