Bug 301527 - Make Default working directory for new Run or Debug Configurations configurable
Summary: Make Default working directory for new Run or Debug Configurations configurable
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 enhancement with 17 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-02 07:08 EST by Immanuel Scholz CLA
Modified: 2014-03-07 04:29 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Immanuel Scholz CLA 2010-02-02 07:08:50 EST
Build Identifier: 20090920-1017

The working directory created for new Run Configurations is hard-coded.

If the configuration has been created directly in the dialog, it seems to be the working directory of eclipse itself (e.g. C:\Program Files\Eclipse) which is almost always a wrong default.

If the configuration has been created by the context menu of a specific file or project, the default working directory is ${workspace_loc:projectname}.

I am used to projects, where you have one project for "Environment" and a lot of different projects (usually containing tests) that all need to have the "Environment" project as "current directory" (to maximize simulation of the original application.

Therefore, I have to manually set the current directory for every run configuration created over and over again. Especially with testing classes, Run Configurations are created constantly. So the step always has to be: Launch the class with context menu, have it fail because of wrong working directory, open Run configuration, change working directory, Run again.

A configurable default working directory would be most appreciated. 


This has been suggested in several forums before. A couple of solutions has been brought up over the years from which non are working anymore:

The old "String Substitution" trick by setting "workspace_loc" to the Environment project location (http://www.eclipse.org/forums/index.php?t=msg&goto=63344) doesn't work anymore, as the String Substitution dialog doesn't support for parameters to variables (or at least I couldn't find any mention in the documentation and all obvious tries failed). 

Passing "-data directory" to eclipse.exe does not seem to have an effect either anymore (http://dev.eclipse.org/newslists/news.eclipse.tools/msg24139.html)

"Duplicate" does not work together with the "Run as" context menu (http://stackoverflow.com/questions/981213/default-eclipse-working-directory).

Reproducible: Always

Steps to Reproduce:
1. Select any file in explorer
2. Right-click, Run-As, some target (e.g. "Java Class")
3. The file will always be run with default working directory, which is ${workspace_loc:projectname}.
Comment 1 Lars Vogel CLA 2012-04-27 14:57:38 EDT
Maybe the option to use the Workspace Data directory might be nice.
Comment 2 Sarika Sinha CLA 2014-03-07 04:29:43 EST
Can we have the default location defined in Run/Debug Preferences as defined for Launch Configurations for Eclipse and Junits under PDE preferences ?