With eclipse, I know how to use variables in my launch configurations. I also know there exist a set of predefined variables such as ECLIPSE_HOME
or WORKSPACE_LOC
.
What I don't know is the extensive list of these predefined variables (ie : variables names and values). Is there such a resource ?
A path variable is a name that is mapped to a specific location on the machine. By using a path variable, you can share projects containing linked resources with team members without requiring the same directory structure as on your file system.
To manually open the view, go to Window | Show View | Other | Debug | Variables.
Environment Variables are attached to a "Run Configuration"(Run -> Run Configurations). Then you create a new Java Application run config, and will see Environment tab on the right panel.
I found a very good example about path variables in eclipse help documentation:
workbench user guide-concepts-ant & external tools
Lets assume your Eclipse workspace directory is: c:\eclipse\workspace
and you have two projects, MyProject1
and MyProject2
. The first project, MyProject1
, is located inside the workspace directory, the second project, MyProject2
, is located outside the workspace directory at c:\projects\MyProject2
. Lets look at how the variable examples below will be expanded when an external tool is run, if the resource /MyProject2/MyFolder/MyFile.txt
is selected.
****Variable Example ~~> Expanded Results****
${workspace_loc} ~~> c:\eclipse\workspace
${workspace_loc:/MyProject1/MyFile.txt} ~~> c:\eclipse\workspace\MyProject\MyFile.txt
${workspace_loc:/MyProject2/MyFile.txt} ~~> c:\projects\MyProject2\MyFile.txt
${project_loc} ~~> c:\projects\MyProject2
${project_loc:/MyProject1/MyFile.txt} ~~> c:\eclipse\workspace\MyProject
${container_loc} ~~> c:\projects\MyProject2\MyFolder
${resource_loc} ~~> c:\projects\MyProject2\MyFile.txt
${project_path} ~~> /MyProject2
${container_path} ~~> /MyProject2/MyFolder
${resource_path} ~~> /MyProject2/MyFolder/MyFile.txt
${project_name} ~~> MyProject2
${container_name} ~~> MyFolder
${resource_name} ~~> MyFile.txt
${build_type} ~~> none
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With