facebook

VM arguments to my Java application not working

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #269978 Reply

    ukafrik
    Member

    Passing System Properties in the VM arguments section in the Run Configuration is not working. How do you configure Run Configuration to pass System Environment Properties to my Java Application. I passed -DDSQUERY where DSQUERY is an environment variable on my Windows machine and then called System.getproperty(“DSQUERY”) in my Java code, but that returned null. What am I doing wrong?

    #270059 Reply

    Loyal Water
    Member

    The way you are passing the VM Arguments and calling System.getProperty(“DSQUERY”) in your java code is the correct way to go about things. Make sure the environment variable your are passing exists. Also make sure your syntax is correct. e.g If your system includes the USERNAME environment variable which needs to be passed, then its would be passed as -DDSQUERY=$USERNAME. This needs to be added to the VM arguments list under the Arguments tab when you run your code.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: VM arguments to my Java application not working

You must be logged in to post in the forum log in