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

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?

1 Answer

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} 
5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like