The Artima Developer Community
Sponsored Link

Java Answers Forum
system properties vs environment variables

1 reply on 1 page. Most recent reply: May 9, 2006 3:59 AM by Rajeev Mutalik

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
M Adawi

Posts: 9
Nickname: adawi
Registered: Mar, 2006

system properties vs environment variables Posted: May 4, 2006 10:44 AM
Reply to this message Reply
Advertisement
What is difference between system properties and environment varaibles ?


Rajeev Mutalik

Posts: 57
Nickname: rajmutalik
Registered: Sep, 2002

Re: system properties vs environment variables Posted: May 9, 2006 3:59 AM
Reply to this message Reply
System properties and environment variables are both conceptually mappings between names and values. Both mechanisms can be used to pass user-defined information to a Java process. Environment variables have a more global effect, because they are visible to all descendants of the process which defines them, not just the immediate Java subprocess. They can have subtly different semantics, such as case insensitivity, on different operating systems. For these reasons, environment variables are more likely to have unintended side effects. It is best to use system properties where possible. Environment variables should be used when a global effect is desired, or when an external system interface requires an environment variable (such as PATH).

On UNIX systems the alphabetic case of name is typically significant, while on Microsoft Windows systems it is typically not. For example, the expression System.getenv("FOO").equals(System.getenv("foo")) is likely to be true on Microsoft Windows.

Flat View: This topic has 1 reply on 1 page
Topic: Switch Statement Previous Topic   Next Topic Topic: Help me, Getting start JSP

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use