• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Injecting properties to a running java program

 
Daesung Park
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic