What is the current working directory when I launch my program from the IDE?


If you create a run configuration then you can specify the current working directory in the Working Directory field. If you leave the Working Directory field blank then the current working directory is set to the project folder.

If you launch a program without a run configuration (i.e. by opening the source code and pressing the run button, or "Run As " menu item) then the current working directory is set to the project's output folder.

If you create a run configuration and want the same behavior as when running without a run configuration then set the Working Directory to your project's output folder.

For example, if your application's properties are in a file named myprog.properties in your project's resources folder then you can leave the Working Directory field blank and specify the properties file in the System Properties field as follows:

-Discobol.conf=resources/myprog.properties

Or you can set the Working Directory field to "output" or another subfolder and specify the properties file in the System Properties field as follows:

-Discobol.conf=../resources/myprog.properties



Article ID: 145
Created: August 24, 2010
Last Updated: August 24, 2010
Author: Support KB Author

Online URL: https://support.veryant.com/support/phpkb/article.php?id=145