0

What is the difference between adding 'VM arguments' using text box and 'Variables' button in eclipse?

Refer to pointers in image.

enter image description here

Vikash Yadav
  • 503
  • 5
  • 19
  • 1
    Only the text box determines the actual arguments. The “Variables...” button only opens a convenience dialog to browse and select variables defined within Eclipse, to be inserted into the arguments, just like the completion in the Java source code editor. – Holger May 09 '19 at 10:46
  • 1
    The _Program arguments_ are the `args` in `public static void main(final String[] args)`. The VM (virtual machine) arguments are e.g. `-Xms256m`, `-Xmx1024m`, `-XX:+UseG1GC`, `-XX:+UseStringDeduplication`, `-DmyProperty=foo`, etc. And the _Variables..._ are Eclipse variables that can be used to define these variables. – howlger May 09 '19 at 10:55
  • @Holger Variables->Edit Variables ->New . allows us to create new variable – Vikash Yadav May 09 '19 at 11:04
  • 1
    The new variable that you can create is not used for anything unless you include it in the Program or VM arguments text. – greg-449 May 09 '19 at 11:20
  • 1
    @VikashYadav The _Edit Variables..._ button is a shortcut to the _Run/Debug > String Substituation_ preferences to extend the global variable pool. Variables created in this way can be used e.g. in the [_Environment_ tab](https://stackoverflow.com/a/53742640/6505250) or in other launch configurations as well. – howlger May 09 '19 at 11:35
  • ok. Variables button was just aside text box so I thought both would have same functionality if varaible is added in any one of them. – Vikash Yadav May 10 '19 at 03:29

0 Answers0