This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Adding entry to default system property. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Adding entry to default system property." Watch "Adding entry to default system property." New topic
Author

Adding entry to default system property.

Chitra Arjunan
Greenhorn

Joined: Mar 03, 2011
Posts: 2
Hi All,

I need to include the system property (as a part of default system property. not in a new property file) that can be accessed across application?
Is it possible?

- Chitra
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10268
    
    8

Welcome to the Ranch.
Have you tried System#setProperty(String key,String value)?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Chitra Arjunan
Greenhorn

Joined: Mar 03, 2011
Posts: 2
Thank.. .yeah i tried that, but the property cannot be shared by other applications, until the other application knows the name of the property file
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10268
    
    8

A system property is a global variable. You do not need the properties file. All your application needs is the name of the property.
PS. Do your applications share the same JVM?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Adding entry to default system property.