This gives me a strange windows error saying - The system cannot find the file -Djava.util.logging.config.file="C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.26\conf\logging.properties", while it actually exists.
If instead of setting the path, I give the absolute path of startup.bat in command, it works fine -
Process p = Runtime.getRuntime().exec("cmd /C start C:\\broadway\\bat\\startup.bat"); //I copied the startup.bat to a folder and ran it from there, it worked fine.
Please give me pointers to the right direction!
Actually, one of the more popular ways to get a Java program to run Tomcat is to have it run embedded. The Tomcat server can be instantiated as a JavaBean and launched directly instead of having to go through the shell interface. The JBoss appserver is an example of this.
However, if that's not appropriate, what I recommend is that you make your request less "Windows-like". The Windows file naming can make a mess of any Java application. So use the forward-slash path separator where you can and avoid file and directory names with spaces in them (like "Program Files").
I think you've also got a problem there because you're attempting to set up a classpath. The Tomcat script files set up the classpath themselves. However, you do have to have the environment variable "JAVA_HOME" set. Other Tomcat environment variables are usually optional.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
a wee bit from the empire
a bit of art, as a gift, that will fit in a stocking