Java system properties are different from environment variables as you
probably know.  If you look at your start up script (tomcat.sh) you will see
that the command is executed with a -Dtomcat.home=${TOMCAT_HOME}.  The -D
parameter is how you set environment properties for Java at run time.  If
you use System.getProperty("tomcat.home") you should get what you are
looking for.
-Jamey

-----Original Message-----
From: Brandon Cruz [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 2:08 PM
To: [EMAIL PROTECTED]
Subject: Accessing environment variables


I have a question which is somewhat off topic...

Is there a way to access my environment varibables(ex. TOMCAT_HOME) from my
servlets running in tomcat?  I just need to somehow return the path to
TOMCAT_HOME.  Is there some simple method call that can achieve this?

Thanks in advance!

Brandon

Reply via email to