Eclipse中的链接

来源:互联网 发布:linux arp s 编辑:程序博客网 时间:2024/06/01 23:37

项目>Properties>Resource>LinkedResources>Linked Resources

就可以看到很多符号链接了,可以更改路径

 

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

  1. In one of the navigation views, right-click the project whereyou want to create the new folder.
  2. From the pop-up menu, select New >Folder.
  3. Specify the name of the folder as it will appear in theworkbench. This name can be different from the name of the folderin the file system.
  4. Click Advanced.
  5. Check Link to folder in the file system.
  6. Enter a file system path, or click Browse toselect a folder in the file system.
  7. Click Finish.


 

To create a linked file, follow the same steps as above, exceptchoose New > File instead ofNew > Folder in the contextmenu.

Linked resource locations can also be specified relative to avariable. This makes it easier to share projects containing linkedresources with other team members, since it avoids hard-codedabsolute file system paths that may vary from one machine to thenext.

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

  1. Click the Variables button.
  2. In the resulting dialog, select an existing path variable orcreate a new one.
  3. If the chosen variable defines the exact path of the linkedresource, click OK. Otherwise, clickExtend to specify a file or folder below thelocation described by the path variable, then clickOK.
  4. Click Finish.

Tip: The Window > Preferences> General > Workspace> Linked Resources preference page alsoallows you to define path variables.

Note that, once you create a linked resource you will not beable to change the link target path that you entered in step 6. or8. above.

0 0
原创粉丝点击