Bug 569664 - Eclipse forgets about environment variable for project.
Summary: Eclipse forgets about environment variable for project.
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.17   Edit
Hardware: PC Windows 10
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-11 11:28 EST by Veli Can Erdem CLA
Modified: 2020-12-15 12:09 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Veli Can Erdem CLA 2020-12-11 11:28:21 EST
Hello,

Severity:
Normal because may not be reproducible in other instances. Otherwise a major tool break I think.

Reproduction: 
Start Eclipse. 
Run External Configuration. 
OR[Terminate, Remove Launch, Remove All Terminated Launches]
Try running any configuration again.

Solution:
Click into any entity in: 
OR[Package Explorer, anything in opened file screen, such as code screen]

Example configuration:
Name: run_xxxxxx
Location: ${env_var:JAVA_HOME}/bin/javaw.exe
Working Directory ${project_loc}
Arguments: -Xms1024m -Xmx1024M -jar SOME_PATH_TO_JAR
Comment 1 Veli Can Erdem CLA 2020-12-12 07:21:49 EST
So apparently per stackoverflow answer it directly requires a file etc selected but it is so counterintuitive to pass cmd-line something that is per selection, especially a mouse one.

workspace_loc worked much better.
Comment 2 Holger Voormann CLA 2020-12-15 12:09:50 EST
When creating an Externals Tools configuration, the working directory is empty. To set the working directory to "${project_loc}" you have to hit the "Variables..." button which opens a dialog where you have to select the "project_loc" variable while the following description for "project_loc" is shown:
"Returns the absolute file system path of a resource's project. The target resource is the selected resource when no argument is specified, or the resource identified by a workspace relative path."

To set working directory to a project (sub-)folder you do not need to know anything about variables. Just hit the "Browse Workspace..." button and choose the folder.

I have no idea what can be done to enhance this in your case (how did you set the working directory to "${project_loc}" and why did you not use the "Browse Workspace..." button?). Please tell exactly what should be enhanced or close this bug as INVALID or as WORKSFORME.

Asked as Stack Overflow question here:
https://stackoverflow.com/q/65254356