Using project_loc and workspace_loc in environment variables in an Eclipse launcher?

Mike Stoddart :

Is anyone using the variables ${project_loc} and ${workspace_loc} in environment variables in an Eclipse launcher? I'm trying to use them, primarily ${project_loc} but nearly every time I run my launcher I get the following:

Variable references empty selection: ${project_loc}

I have four environment variables defined, two of which use ${project_loc}, though I've also tried ${workspace_loc}. These Maven projects were created outside of Eclipse and then imported as "Existing Maven projects". This may have something to do with the problem but I'm confused as to how to proceed.

Is anyone using these environment variables successfully?

greg-449 :

The description in the help for 'project_loc' says

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.

So ${project_loc} returns the project containing the current selection - if there is no selection you get the error. It is better to use an argument to project_loc:

${project_loc:/MyProject}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=366695&siteId=1