setting system propertes

R

Roedy Green

You can set system properties on the command line with
java.exe -Dflavour=strawberry -jar x.jar parm1

You can set them in signed JNLP files.

Is there any other way to set them, say with SETs, or with

x.jar parm1

or by reading them from a *.properties file.
 
A

Arne Vajhøj

You can set system properties on the command line with
java.exe -Dflavour=strawberry -jar x.jar parm1

You can set them in signed JNLP files.

Is there any other way to set them, say with SETs, or with

x.jar parm1

or by reading them from a *.properties file.

Are you asking if you can read data from a properties file
and use that data to call System.setProperty?

Arne
 
M

markspace

Are you asking if you can read data from a properties file
and use that data to call System.setProperty?


You have to be careful of this though, because some parts of the system
(notably the logger in my experience) can initialize before even your
main() entry point is called. (And the logger does look at system
properties to initialize.)

Sometimes System.setProperty() will work for ya, and sometime it won't.

But yeah generally this is an RTFM type question.

I think however Roedy might be asking for his web site, to make sure he
hasn't missed any details or standard practice. I think it might be
better if he stated his goal, though, since his OP makes it sound like
he's just looking for one answer.


P.S. I don't know any other techniques other than what's been mentioned
so far.
 
R

Roedy Green

I think however Roedy might be asking for his web site, to make sure he
hasn't missed any details or standard practice. I think it might be
better if he stated his goal, though, since his OP makes it sound like
he's just looking for one answer.

You are exactly right. I am tidying up the entry
at http://mindprod.com/jgloss/properties.html

I wanted to enumerate all the ways of setting system properties.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top