permaculture playing cards
The moose likes Tomcat and the fly likes To Detect Tomcat path from java application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "To Detect Tomcat path from java application" Watch "To Detect Tomcat path from java application" New topic

To Detect Tomcat path from java application

Syed Saifuddin
Ranch Hand

Joined: Sep 01, 2003
Posts: 130

I want to make installer of my web application. For this I need to know where the Tomcat is installed (and either it is install or not) to drop the folder of my web application in the webapps folder of tomcat.

Any help or idea is appreciated

Thank You

Thank You & Best Regards,

Syed Saifuddin,
Senior Software Engineer

SAP Oracle AIX & Java Training
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

That may not be possible.
Prompt the user to enter TOMCAT_HOME during install or enter the value in a properties files which your application reads from.

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Depending on how they've installed it, you may have the CATALINA_HOME or CATALINA_BASE environment variables available.

Just knowing the location of the Tomcat installation, doesn't mean that you will know where to find the host directory. Tomcat can be configured in all kinds of ways. There is no guarantee that dropping a war file in the webapps directory will cause your app to be deployed unless you know that you're dealing with a default install.

I'm going to move this to the Apache Tomcat forum since it's more specific to Tomcat than to Servlets in general.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: To Detect Tomcat path from java application
It's not a secret anymore!