File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Injecting properties to a running java program

 
Daesung Park
Ranch Hand
Posts: 68
  • 0
  • 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: 9495
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • 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...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic