Sometimes, the application has to be invoked with some arguments for other execution options to suit different purposes. For example, Internet Explorer supported the following options
(adopt from http://msdn.microsoft.com/en-us/library/ee330728(v=VS.85).aspx)
iexplore.exe [ [ -embedding ] [ -extoff ] [ -framemerging ] [ -k ] [ -noframemerging ] [ -nohangrecovery ] [ -private ] ] [ URL ]
If you are going to develop your program in Eclipse and want to test your application with different options, you may follow the instructions below.
- Open your project in Eclipse.
- In Project Explorer, find your project.
- Right-click and select Properties and then Properties Windows appears.
- In the menu on the left, click Run/Debug Settings.
- On the right, select a Launch configuration (by default there is at least one)
- Press Edit to change the configuration
As you can see, there are a number of configurations but we only focus on the settings in the Arguments tab.
- In the Arguments tab, input your arguments for the program. Each line is for one argument.
- If you do not want to use the default Working directory, unchecked Use default. This is useful if you want to open a file that is in the same directory as the executable. Suppose the executable named MyApp1. To specify the directory,
- For C++ project, very often, we change it from ${workspace_loc:MyApp1} to ${workspace_loc:MyApp1/Debug}
- For Java project, very often, we change it from ${workspace_loc:MyApp1} to ${workspace_loc:MyApp1/bin}