Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To Detect Tomcat path from java application

 
Syed Saifuddin
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

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
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

ram.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic