1) This isn't a Tomcat question: if you'd done the same in a java
application, you'd have found the same thing.  There are forums, newsgroups,
and mailing lists for Java questions.

2) You're confusing environment variables with properties.  Properties are
defined either by loading them from a properties file, or by specifying them
on java's command line (with "-D").

3) There is a method, System.getenv(), to get environment variables, but
it's deprecated (the whole concept of environment variables is incredibly
OS-specific).  So you really _should_ be using properties, or
<context-param> elements defined in your application's web.xml.  Look at
java.util.Properties for the former, and the servlet spec for the latter.

                                        -- Bill K. 

> -----Original Message-----
> From: Nilanjan Das [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 07, 2001 7:12 AM
> To: tomcat jakarta
> Subject: Getting the user environment variable::Need help
> 
> 
> Hi,
> 
> I am on HP-UX and trying to access one user environment varaible from
> the Java code using
> System.getProperty() method but it is returning NULL. Can anyone point
> out why? This is what I did:
> 
> $export TEST=testing
> $echo $TEST
> testing
> 
> But when I execute System.getProperty("TEST") from my code, it returns
> NULL.
> 
> Can any of you help?
> 
> Thanks,
> Nilanjan
> 
> 

Reply via email to