CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2009
    Posts
    3

    Debug/Run Configurations in Eclipse

    Does anybody know where I can find a good tutorial on how to use the Run/Debug Configurations in Eclipse?

    I have a lot of questions: for example I have defined a variable in the Environment tab. How do I refer to it in the Arguments tab?
    I have tried %VAR_NAME%, ${VAR_NAME}, etc. but no luck.

    Any idea?

    Thank you!

  2. #2
    Join Date
    Oct 2008
    Posts
    77

    Re: Debug/Run Configurations in Eclipse

    if it is argument then it is simply string and up to your program to interpret it.

  3. #3
    Join Date
    Jul 2009
    Posts
    3

    Re: Debug/Run Configurations in Eclipse

    I think I didn't explain myself very well.

    In the Debug/Run Configurations wizard there is a tab called "Environment" and a tab called "Arguments". I thought I would be able to define a variable in the "Environment" tab and then use it in the "Arguments" tab.

    For example I have defined a variable in the "Environment" tab called:

    FAMILY_HOME=c:/home/europe

    and in the "Arguments" tab (VM arguments textbox) I would like to define something like:

    -DmyFolder=%FAMILY_HOME%/uk/england/london/lewisham

    THE PROBLEM IS, %FAMILY_HOME% is not replaced with the value c:/home/europe. I'm pretty sure is a syntax problem. I have tried to use ${FAMILY_HOME} or $FAMILY_HOME, but they don't work either. I've done a search on the internet, but I couldn't find a good tutorial with examples on the Debug/Run Configurations wizard.

    Any idea?

  4. #4
    Join Date
    May 2002
    Location
    Lindenhurst, NY
    Posts
    867

    Re: Debug/Run Configurations in Eclipse

    In the 'Run Configurations' dialog, 'Arguments' tab, there should be a button 'Variables...'. Clicking that button brings up a list of Eclipse variables, one of which is 'env_var'. Look into that. I beleive the Eclipse variables are documented in Eclipse's help, and there's a brief description in the variable dialog. I haven't used an environment variable myself, but it looks like that's what you should use.

  5. #5
    Join Date
    Jul 2009
    Posts
    3

    Re: Debug/Run Configurations in Eclipse

    Thank you Martin: your suggestion sounded sensible, but unfortunately it doesn't work.
    I've tried:

    -DmyFolder=${env_var:FAMILY_HOME}/uk/england/london/lewisham

    but it still doesn't replace it with the value.
    I wonder what the point of the "Environment" tab is if the variables there defined cannot be used!
    I am also surprised on how poor the documentation is on the topic, since launchers files seem such a useful feature to me.

  6. #6
    Join Date
    May 2002
    Location
    Lindenhurst, NY
    Posts
    867

    Re: Debug/Run Configurations in Eclipse

    Yeah, I just tried & saw it doesn't work. It does work if you use a real environment variable, like 'PATH' or 'HOMEDRIVE' (Windows XP environment variables). But I couldn't get it to work with an environment variable defined in the Run Configuration -> Environment tab. I'd try asking on an Eclipse forum if you haven't already.

  7. #7
    Join Date
    Aug 2009
    Posts
    1

    Re: Debug/Run Configurations in Eclipse

    Just ran into this problem today and saw your post trying to find a solution. I am using Eclipse3.3.
    In the Debug window, on the arguments tab -
    1. click on the Variables button, small dialog opens
    2. click on Edit Variables (the button is mislabeled), another dialog box opens
    3. add variable name, value, description (do not use double quotes, i.e. defining Windows paths)
    EXAMPLE: LOGPATH C:\Documents and Settings\My Documents\Test Env test env
    4. click ok
    5. verify the new variable LOGPATH is defined in the "Select Variable" dialog box
    6. click ok
    7. In the program arguments textbox, define the argument using double quotes
    EXAMPLE: "${LOGPATH}\sgwb1.log"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured