• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

System Properties!!

 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
could someone please explain me the use of system properties class that java provides? some of the books says that System properties are another mechanism used to parameterize a program at run time. but i can't see how? please help me.
thanks.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think u should better go thru the following site, which explains neatly about the usage of the System Properties (i.e., Accessing System Resources at Runtime).
http://java.sun.com/docs/books/tutorial/essential/system/properties.html
It's nifty to work with this... Enjoy urself too...
 
Brian Smith
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
like you suggested, i read about the system properties class in the following site.

Originally posted by Anupama Dande:
I think u should better go thru the following site, which explains neatly about the usage of the System Properties (i.e., Accessing System Resources at Runtime).
http://java.sun.com/docs/books/tutorial/essential/system/properties.html



But i still can't see how we can make use of this feature to parameterize a program at run time. could you please give me some real world instances we could make use of this features?
Also, when i read an example, this features let us know things like "file.separator","java.class.path","java.class.version","os.name"...etc. why do we need to know these at run time?
please help me.
thanks.
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi sathi
Also, when i read an example, this features let us know things like "file.separator","java.class.path","java.class.version","os.name"...etc. why do we need to know these at run time?
we need to have them at run time in case we want to migrate code across various platforms.
for e.g. if we code using file separator as "/" which is for Unix based systems then we have to change it when we give our program to a friend running windows as the file separator is "\" on windows.
well, u might think this is just a little change but its better to avoid that as well in cases when v r going to provide the compiled classes ONLY to the others for running them and we don't know which system they have...
to give u an example of the use of "runtime" properties,
there r some java properties which certain APIs uses and we can specify their values using switches like "-D" at runtime. u can go to,
RMI tutorial page which one of the many examples how ppl use "-D" switch and specify property values at run time for,
java.rmi.server.codebase etc...
u can use those properties with System.getProperty("java.rmi.server.codebase") as well...u know..
hope u c some direction here
regards
maulin
 
if you think brussel sprouts are yummy, you should try any other food. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic