aspose file tools*
The moose likes Java in General and the fly likes Injecting properties to a running java program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Injecting properties to a running java program" Watch "Injecting properties to a running java program" New topic
Author

Injecting properties to a running java program

Daesung Park
Ranch Hand

Joined: Mar 22, 2007
Posts: 68
Hi,

Is it possible to inject(or modify) properties to a running java program?
For example, is the following scenario feasible?
1. Run a java program
> java -Dprop="x" mytest.class
2. Get pid
> jps
3. Inject a property
> injectprop [pid] prop="Y"
(injectprop is imaginary one.)

I think it is impossible.
If it is really impossible, can you let me know related Java specifications or just links?

Daesung Park

BLOG
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9304
    
  17

I don't know about regular properties loaded into jvm but you can load a set of custom properties from a properties file using Properties and File classes...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Injecting properties to a running java program