javaeclipselaunch-configuration

Using env. variables as VM argument in launch configuration


I have a eclipse project which connects to different environments based on VM parameters passed in launch configuration. In order to achieve this i have set env. variables in "launch configuration -> environment" and then tried to pass them as VM argument but i get an error as eclipse is not able to resolve those env. variable.

Any guidance on how to achieve this?


Solution

  • Just below "VM arguments" window there is button called "Variables". Eclipse VM args

    When you click on variables it will give you an option to create new variable which can then be used in vm args as "${new_var}".

    So probably we can't use env. variables as VM args in eclipse but this is a way out.