This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

-D system properties option

 
Henning Ludeke
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9510
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15214
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Henning Ludeke
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15214
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd recommend not getting too hung up on minutiae like this very often, or you'll go mad.
 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:I'd recommend not getting too hung up on minutiae like this very often, or you'll go mad.

 
Henning Ludeke
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks everybody

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic