This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes -D system properties option Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "-D system properties option " Watch "-D system properties option " New topic
Author

-D system properties option

Henning Ludeke
Greenhorn

Joined: Feb 17, 2010
Posts: 4
Hi

I would like to know what does the 'D' denote?

I know how to use it, but I would just like to know if the D stands for anything specific.

Thanks,

Henning
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

You can find information about the different options of java command here. -D is used to set system properties, these properties can be used by your application or by the JVM. You can find some more details here...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Welcome to JavaRanch.

Maybe the "D" stands for "Define". But that's just a guess. The documentation doesn't say why the letter "D" is used or what it stands for.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Henning Ludeke
Greenhorn

Joined: Feb 17, 2010
Posts: 4
It's driving me crazy. I want to know why it is a 'D'

Maybe we should email Dr. Gosling

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

I don't know if you know C or C++, but in those languages you have a precompiler. You can use #define in a source file to define for example constants etc., like this:

Some C or C++ compilers allow you to define constants on the command line, when you invoke the compiler. Like this:
gcc -DMAGIC_NUMBER=23 example.c -o example

I guess the "-D" in Java has a similar function (although Java doesn't have a preprocessor and you're not defining compile-time constants with it).

If you're still not satisfied with the answer, you can indeed try asking the big boss...
Henning Ludeke
Greenhorn

Joined: Feb 17, 2010
Posts: 4
Jesper - that makes sense.

Java is the first language that I'm delving into -
I guess if I had experience with C++ I would've been familiar with 'define' - it makes sense.

No more ...

Thanks Jesper

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'd recommend not getting too hung up on minutiae like this very often, or you'll go mad.
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
David Newton wrote:I'd recommend not getting too hung up on minutiae like this very often, or you'll go mad.



Thanks and Regards
Henning Ludeke
Greenhorn

Joined: Feb 17, 2010
Posts: 4
Thanks everybody

 
Consider Paul's rocket mass heater.
 
subject: -D system properties option
 
Similar Threads
Sun java voucher for sale.
javaranch mail
best books to refer SCDWS ?
Weblogic on Linux
IBM SOA Certification Test 665