Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between -D and -X options while passing parameters to JVM.

 
NareshAnkuskani Kumar
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In maven we use maven_opts to pass parameters to the Java VM.

E.g. : set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000

I am aware of the -D option. It is used to send the java system property. What exactly '-X' option represent?

I am aware of the -Xms, -Xmx options which are used to set the heap size.

In the above example what exaclty the line/point "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000" represent or what is does?

Thanks in advance.

Regards,
Naresh.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18214
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
X stands for eXtension. Any "X" parameter is vendor-specific, and unlike the other options isn't guaranteed to be available on all JVM implementations - for example, IBM's jikes or the open-source IcedTea VMs.
 
Mariana Costa
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So if -X for eXtension, what does -D stands for?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18214
53
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mariana Costa wrote:So if -X for eXtension, what does -D stands for?


"define". I've used it in Kettle to pass in alternative package paths for custom plugins when I didn't want them in the main Kettle package hierarchy.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The -D is used to set system properties. Any Java code can then access any property so defined via System.getProperty().
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to Javaranch Mariana!
 
Mariana Costa
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:
Mariana Costa wrote:So if -X for eXtension, what does -D stands for?


"define". I've used it in Kettle to pass in alternative package paths for custom plugins when I didn't want them in the main Kettle package hierarchy.


Ah, "Define"! Very creative =)
Thanks Tom.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic