Sachin Pathak, You can use the following to obtain an environment variable: public static String TOMCAT_HOME = System.getProperty("catalina.home"); The above will return the TOMCAT_HOME, but you can substitute any valid environment value for "catalina.home" to retreive the setting, i.e. "java_home". HTH. Regards, Todd Nist
If you don't mind, please outline why you would want to do this? If you decide later to use an other web container, this code will not work. If you need to find the base directory of your web app, use the ServletContext.getResourceAsStream() method, or the class loader's getResourceAsStream method. It's far more portable.