eclipse中有哪些预定义变量?

fxm*_*fxm 7 eclipse eclipse-luna

使用eclipse,我知道如何在我的启动配置中使用变量.我也知道存在一组预定义变量,如ECLIPSE_HOMEWORKSPACE_LOC.

我不知道的是这些预定义变量的广泛列表(即:变量名称和值).有这样的资源吗?

Wei*_*Wei 6

我在eclipse帮助文档中找到了一个关于路径变量的非常好的例子:workbench用户指南 - 概念 - ant和外部工具

假设你的Eclipse工作区目录是c:\ eclipse\workspace,你有两个项目,MyProject1和MyProject2.第一个项目MyProject1位于工作区目录内,第二个项目MyProject2位于工作区目录外的c:\ projects\MyProject2.让我们看一下如果选择资源/MyProject2/MyFolder/MyFile.txt,在运行外部工具时如何扩展下面的变量示例.

变量示例

扩大的结果

<p>

    ${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

</p>
Run Code Online (Sandbox Code Playgroud)


gre*_*449 5

如果您指的是在启动配置中的“位置”字段等内容中指定的变量,则单击该字段旁边的“变量...”按钮会显示当前定义的变量的完整列表。

由于插件可以向此列表添加新变量,因此实际上不可能给出明确的列表,因为这取决于您安装的插件。


Aar*_*lla 1

打开首选项并搜索“Classpath Variables”。

  • 谢谢 !但是,它似乎并不包含所有变量(例如“WORKSPACE_LOC”)。 (2认同)