File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Can programatically add property to System properties 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 "Can programatically add property to System properties" Watch "Can programatically add property to System properties" New topic
Author

Can programatically add property to System properties

Herbert Kornfeld
Ranch Hand

Joined: Apr 16, 2003
Posts: 32
Hi,
Is it possible to programmatically add a property to the System(class) properties - I know I can add some on the command line with -Dname=value but I am wondering if I can do it inside the application. I have already used System.setProperty but that seems to be only for updating already existing properties.
Many Thanks
Herbert Kornfeld
Ranch Hand

Joined: Apr 16, 2003
Posts: 32
After further testing - it is possible with the setProperty method.
So I answered my own question.
:roll:
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
So I answered my own question.
Glad we could help Herbert.


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can programatically add property to System properties