CATALINA_HOME is a shell variable (DOS\UNIX, or whatever type of system you are running on). It is not variable of the JVM that started Tomcat. Now, of course, you could pass CATALINA_HOME to your JVM. But, the only variables that System.getProperty will retrieve are the ones of the JVM. To see what you have available, you could do:
public class getEnv { public getEnv() { } public static void main(String args[]) { Properties properties = System.getProperties(); Enumeration enumeration = properties.propertyNames(); if(args.length == 0) { String s; String s1; for(; enumeration.hasMoreElements(); System.out.println(s + ": \t " + s1)) { s = (String)enumeration.nextElement(); s1 = System.getProperty(s); } } else { for(int i = 0; i < args.length; i++) { String s2 = System.getProperty(args[i]); System.out.println(args[i] + ": \t" + s2); } } } } -----Original Message----- From: Raja Sekhar [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2003 9:59 AM To: [EMAIL PROTECTED] Subject: How to get catalina_home variable Hi, I am using Tomcat 4.0.6. I am writing a JSP in which I want to get the catalina_home path. I am giving the code as System.getProperty("CATALINA_HOME"). This is retreving me null. I am running tomcat using startup.bat. Please help me asap if you have any suggestions. Thanks & Regards, ..Raj Need a new email address that people can remember Check out the new EudoraMail at http://www.eudoramail.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]