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 Ant, Maven and Other Build Tools and the fly likes Difference between -D and -X options while passing parameters to JVM. 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 » Engineering » Ant, Maven and Other Build Tools
Bookmark "Difference between -D and -X options while passing parameters to JVM." Watch "Difference between -D and -X options while passing parameters to JVM." New topic
Author

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

NareshAnkuskani Kumar
Ranch Hand

Joined: Sep 15, 2005
Posts: 76
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

Joined: Jun 25, 2001
Posts: 15952
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Mariana Costa
Greenhorn

Joined: Mar 07, 2008
Posts: 2
So if -X for eXtension, what does -D stands for?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

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

Joined: May 14, 2008
Posts: 5812
    
    7

The -D is used to set system properties. Any Java code can then access any property so defined via System.getProperty().


JBoss In Action
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

And welcome to Javaranch Mariana!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Mariana Costa
Greenhorn

Joined: Mar 07, 2008
Posts: 2
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Difference between -D and -X options while passing parameters to JVM.
 
Similar Threads
How to debug a remote application using Eclipse IDE.
Remote Debugging in EAServer
How to configure Tomcat 5.5 for debug mode?
How to debug a web service with a axis2 stand-alone server?
Eclipse Out of memory error