• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

-D system properties option

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd recommend not getting too hung up on minutiae like this very often, or you'll go mad.
 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks everybody

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic