eclipse中 linked resource的使用

本文介绍了Eclipse中Linked Resources的概念及其应用场景,包括如何创建Linked Folder及Linked File,并提供了使用Linked Resources来统一资源管理的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、关于linked resource  
eclipse 中的linkded resources 是指存放在项目所在位置以外某个地方的文件或者文件夹;这些特定的资源必须有一个项目作为他们的父资源。linkded resources可以用来给项目添加某些资源,这些资源因为某些原因必须被报春到项目以外的某个地方。
    你可以使用linked resources来覆盖在workspace中的其他资源;从而使得一个项目的资源可以出现在另外一个项目中;这意味着,一个地方的改变可以使另外一个地方的资源同时发生改变;删除一个资源副本,会导致两个地方的资源同时被删除。
    删除linked resources不会导致资源从文件系统中删除,但是删除linked folder下的资源,则会导致资源从文件系统中被删除。
二、创建linked resource
1).创建一个linked folder

In one of the navigation views, right-click the project where you want to create the new folder.
From the pop-up menu, select New > Folder.
Specify the name of the folder as it will appear in the workbench. This name can be different from the name of the folder in the file system.
Click Advanced.
Check Link to folder in the file system.
Enter a file system path, or click Browse to select a folder in the file system.
Click Finish.


To create a linked file, follow the same steps as above, except choose New > File instead of New > Folder in the context menu.

Linked resource locations can also be specified relative to a variable. This makes it easier to share projects containing linked resources with other team members, since it avoids hard-coded absolute file system paths that may vary from one machine to the next.

To define a linked resource relative to a path variable, do the following after step 5 above:

Click the Variables button.
In the resulting dialog, select an existing path variable or create a new one.
If the chosen variable defines the exact path of the linked resource, click OK. Otherwise, click Extend to specify a file or folder below the location described by the path variable, then click OK.
Click Finish.
Tip: The Window > Preferences > General > Workspace > Linked Resources preference page also allows you to define path variables.

Note that, once you create a linked resource you will not be able to change the link target path that you entered in step 6. or 8. above.

 

参考:elipse 帮助文档

 


本文来自优快云博客,转载请标明出处:http://blog.youkuaiyun.com/wsmyf7958/archive/2007/05/16/1611781.aspx

### Eclipse 的汉化处理 对于希望使用中文界面的开发者来说,可以通过安装 Babel 项目提供的语言包来实现 Eclipse IDE 的汉化。访问官方的语言包下载页面(http://www.eclipse.org/babel/downloads.php),定位至所需版本如 Neon 或其他相应版本[^1]。 #### 下载并应用中文语言包 具体操作如下: - 访问 http://download.eclipse.org/technology/babel/babel_language_packs/R0.14.0/neon/neon.php 页面获取对应版本的语言包; - 找到并点击 “Chinese(Simplified)”,进而下载适合的 ZIP 文件,例如 `BabelLanguagePack-eclipse-zh_4.6.0.v20160813060001.zip`; - 解压缩所获得的ZIP文件后,将解压出来的 feature 和 plugins 文件夹复制到 Eclipse 安装路径中的 dropins 文件夹下; 完成上述步骤之后,重新启动 Eclipse 即可呈现简体中文界面。值得注意的是,为了防止因字符编码不一致而引发的问题,建议调整工作区的字符集为 UTF-8 编码[^2]。 ```xml <projectDescription> ... <natures> <nature>org.eclipse.jdt.core.javanature</nature> </natures> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> </buildCommand> </buildSpec> <!-- 设置项目的默认编码 --> <linkedResources> <link> <name>.settings/org.eclipse.core.resources.prefs</name> <type>2</type> <locationURI>platform:/resource/${PROJECT_NAME}/.settings/org.eclipse.core.resources.prefs</locationURI> </link> </linkedResources> </projectDescription> ``` 此配置片段展示了如何通过 `.project` 文件指定 Java 项目的构建属性,并间接提示应考虑设置合适的编码方式以支持多语言环境。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值