Can you please give me more INFO how am I going to use
-D on command line to compile to add setProperty?
Thank you
-sem
Alan Krueger - 14 Mar 2007 05:35 GMT
> Can you please give me more INFO how am I going to use
> -D on command line to compile to add setProperty?
The Java command-line allows you to specify system properties with the
-D<name>=<value> option. You can also programmatically set system
properties using the System.setProperty method.
I'm afraid I can't make out what you're asking beyond that, though.
Mark Jeffcoat - 14 Mar 2007 06:31 GMT
> Can you please give me more INFO how am I going to use
>
> -D on command line to compile to add setProperty?
It's used at run time, not compile time.
public class Demo {
public static void main(String[] args) {
System.out.println(System.getProperty("foo"));
}
}
java -Dfoo="meaningful value" Demo
Will print "meaningful value" on stdout.
(If you have a property you want to set at compile time,
you can just write it directly into the program you're
compiling.)

Signature
Mark Jeffcoat
Austin, TX