0

How can I get remote server catalina.base path like we do for local server ?

String catalinaBase = System.getProperty("catalina.base");
Lusi
  • 391
  • 9
  • 28

2 Answers2

0

It will depend on your tomcat installation. System.getProperty() will return values from system properties/environment variables. If your tomcat installation has set CATALINA_HOME then you can use that. Look at this Tomcat installation

If you are trying this on a server you visit this Getting tomcat's installation directory using java

Ankit Katiyar
  • 2,631
  • 2
  • 20
  • 30
0

I'd advise you not to use container specific properties but to specify your own system property and start tomcat (or any other servlet container) with it:

-Dconfig.dir=/path/to/config
System.getProperty("config.dir");
DJDaveMark
  • 2,669
  • 23
  • 35